From ff8f38eef4b7075bb197a685885226d1087097ee Mon Sep 17 00:00:00 2001 From: Luke Browning Date: Fri, 9 Aug 2024 17:28:42 -0700 Subject: [PATCH] Add include/exclude groups config for dex + cb scraper --- examples/config.yml | 16 ++++++++++++++++ internal/sources/cubari/config.go | 9 +++++++++ internal/sources/mangadex/config.go | 9 +++++++++ 3 files changed, 34 insertions(+) diff --git a/examples/config.yml b/examples/config.yml index 75dd974..b97700f 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -38,5 +38,21 @@ sources: ratingFilter: ["safe", "suggestive", "erotica"] languageFilter: ["en"] # , "fr" dataSaver: false + groups: + # Only download chapters from and + # include: + # - "Example A" + # - "Example B" + # Do not download chapters from + exclude: + - "Example C" cubari: filenameTemplate: "{num:4} - Chapter {num:2}{title: - <.>}{groups: {<.>}}" # Set specific for source (overrides global) + groups: + # Only download chapters from and + # include: + # - "Example A" + # - "Example B" + # Do not download chapters from + exclude: + - "Example C" diff --git a/internal/sources/cubari/config.go b/internal/sources/cubari/config.go index 7c7e758..1dbe3b8 100644 --- a/internal/sources/cubari/config.go +++ b/internal/sources/cubari/config.go @@ -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) { @@ -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{} } diff --git a/internal/sources/mangadex/config.go b/internal/sources/mangadex/config.go index f7a9af4..4488417 100644 --- a/internal/sources/mangadex/config.go +++ b/internal/sources/mangadex/config.go @@ -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"` } @@ -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 }