Skip to content

Commit

Permalink
draft/multiple-urls-per-site (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhm authored Jan 3, 2023
1 parent 42a880c commit cf7acd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Girbons/comics-downloader

go 1.17
go 1.18

require (
fyne.io/fyne v1.4.3
Expand Down
7 changes: 5 additions & 2 deletions pkg/sites/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/Girbons/comics-downloader/pkg/config"
"github.com/Girbons/comics-downloader/pkg/core"
"github.com/Girbons/comics-downloader/pkg/util"
"golang.org/x/exp/slices"
)

func initializeCollection(issues []string, options *config.Options, base BaseSite) ([]*core.Comic, error) {
Expand Down Expand Up @@ -86,17 +87,19 @@ func notInIssuesRange(issueNumber string, start, end float64) bool {

// LoadComicFromSource will return an `comic` instance initialized based on the source
func LoadComicFromSource(options *config.Options) ([]*core.Comic, error) {
// this probably needs to land in the comicextra.go
const supportedComicExtra := []string{"ww1.comciextra.com", "www.comicextra.com"}
var (
base BaseSite
issues []string
collection []*core.Comic
err error
)

switch options.Source {
switch sourceUrl := options.Source; sourceUrl {
case "readcomiconline.li":
base = NewReadComiconline(options)
case "www.comicextra.com":
case supportedComicExtra.contains(soureUrl):
base = NewComicextra(options)
case "mangareader.tv":
base = NewMangareader(options)
Expand Down

0 comments on commit cf7acd0

Please sign in to comment.