Autotag scraper (#1817)

* Refactor scraper structures
* Move matching code into new package
* Add autotag scraper
* Always check first letter of auto-tag names
* Account for nulls

Co-authored-by: Kermie <kermie@isinthe.house>
This commit is contained in:
WithoutPants
2021-10-11 23:06:06 +11:00
committed by GitHub
parent b5381ff071
commit e9d48683f8
22 changed files with 1023 additions and 660 deletions

View File

@@ -4,6 +4,7 @@ import (
"strings"
"github.com/stashapp/stash/pkg/logger"
"github.com/stashapp/stash/pkg/models"
)
// FreeonesScraperID is the scraper ID for the built-in Freeones scraper
@@ -122,13 +123,13 @@ xPathScrapers:
# Last updated April 13, 2021
`
func getFreeonesScraper() config {
func getFreeonesScraper(txnManager models.TransactionManager, globalConfig GlobalConfig) scraper {
yml := freeonesScraperConfig
scraper, err := loadScraperFromYAML(FreeonesScraperID, strings.NewReader(yml))
c, err := loadConfigFromYAML(FreeonesScraperID, strings.NewReader(yml))
if err != nil {
logger.Fatalf("Error loading builtin freeones scraper: %s", err.Error())
}
return *scraper
return createScraperFromConfig(*c, txnManager, globalConfig)
}