mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Add Xpath post processing and performer name query (#333)
* Extend xpath configuration. Support concatenation * Add parseDate parsing option * Add regex replacements * Add xpath query performer by name * Fix loading spinner on scrape performer * Change ReplaceAll to Replace
This commit is contained in:
@@ -41,6 +41,9 @@ type scraperTypeConfig struct {
|
||||
Script []string `yaml:"script,flow"`
|
||||
Scraper string `yaml:"scraper"`
|
||||
|
||||
// for xpath name scraper only
|
||||
QueryURL string `yaml:"queryURL"`
|
||||
|
||||
scraperConfig *scraperConfig
|
||||
}
|
||||
|
||||
@@ -56,6 +59,8 @@ func (c *performerByNameConfig) resolveFn() {
|
||||
c.performScrape = scrapePerformerNamesScript
|
||||
} else if c.Action == scraperActionStash {
|
||||
c.performScrape = scrapePerformerNamesStash
|
||||
} else if c.Action == scraperActionXPath {
|
||||
c.performScrape = scrapePerformerNamesXPath
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,6 +271,11 @@ func (c scraperConfig) ScrapePerformer(scrapedPerformer models.ScrapedPerformerI
|
||||
return c.PerformerByFragment.performScrape(c.PerformerByFragment.scraperTypeConfig, scrapedPerformer)
|
||||
}
|
||||
|
||||
// try to match against URL if present
|
||||
if scrapedPerformer.URL != nil && *scrapedPerformer.URL != "" {
|
||||
return c.ScrapePerformerURL(*scrapedPerformer.URL)
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user