Skip to content

Commit

Permalink
Add include/exclude groups config for dex + cb scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
browningluke committed Aug 10, 2024
1 parent 7576ff7 commit ff8f38e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,21 @@ sources:
ratingFilter: ["safe", "suggestive", "erotica"]
languageFilter: ["en"] # , "fr"
dataSaver: false
groups:
# Only download chapters from <Example A> and <Example B>
# include:
# - "Example A"
# - "Example B"
# Do not download chapters from <Example C>
exclude:
- "Example C"
cubari:
filenameTemplate: "{num:4} - Chapter {num:2}{title: - <.>}{groups: {<.>}}" # Set specific for source (overrides global)
groups:
# Only download chapters from <Example A> and <Example B>
# include:
# - "Example A"
# - "Example B"
# Do not download chapters from <Example C>
exclude:
- "Example C"
9 changes: 9 additions & 0 deletions internal/sources/cubari/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ package cubari
var config Config

type Config struct {
// Scraper
FilenameTemplate string `yaml:"filenameTemplate"`

// Groups
Groups struct {
Include []string `yaml:"include"`
Exclude []string `yaml:"exclude"`
} `yaml:"groups"`
}

func SetConfig(cfg Config) {
Expand All @@ -12,4 +19,6 @@ func SetConfig(cfg Config) {

func (c *Config) Default() {
c.FilenameTemplate = "" // No override of downloader.output.filenameTemplate
c.Groups.Include = []string{}
c.Groups.Exclude = []string{}
}
9 changes: 9 additions & 0 deletions internal/sources/mangadex/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ type Config struct {
LanguageFilter []string `yaml:"languageFilter"`
DataSaver bool `yaml:"dataSaver"`

// Groups
Groups struct {
Include []string `yaml:"include"`
Exclude []string `yaml:"exclude"`
} `yaml:"groups"`

// Connection
SyncDeletions bool `yaml:"syncDeletions"`
}
Expand All @@ -23,5 +29,8 @@ func (c *Config) Default() {
c.LanguageFilter = []string{"en"}
c.DataSaver = false

c.Groups.Include = []string{}
c.Groups.Exclude = []string{}

c.SyncDeletions = false
}

0 comments on commit ff8f38e

Please sign in to comment.