mirror of
https://github.com/stashapp/stash.git
synced 2025-12-14 20:33:16 +01:00
Merge 8dff48eda8 into 39fd8a6550
This commit is contained in:
commit
e32fbad3e8
1 changed files with 15 additions and 2 deletions
|
|
@ -322,14 +322,17 @@ func (s *mappedImageScraperConfig) UnmarshalYAML(unmarshal func(interface{}) err
|
|||
|
||||
type mappedPerformerScraperConfig struct {
|
||||
mappedConfig
|
||||
|
||||
Tags mappedConfig `yaml:"Tags"`
|
||||
Images mappedConfig `yaml:"Images"`
|
||||
Tags mappedConfig `yaml:"Tags"`
|
||||
}
|
||||
type _mappedPerformerScraperConfig mappedPerformerScraperConfig
|
||||
|
||||
const (
|
||||
mappedScraperConfigPerformerTags = "Tags"
|
||||
)
|
||||
const (
|
||||
mappedScraperConfigPerformerImages = "Images"
|
||||
)
|
||||
|
||||
func (s *mappedPerformerScraperConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
// HACK - unmarshal to map first, then remove known scene sub-fields, then
|
||||
|
|
@ -343,8 +346,10 @@ func (s *mappedPerformerScraperConfig) UnmarshalYAML(unmarshal func(interface{})
|
|||
thisMap := make(map[string]interface{})
|
||||
|
||||
thisMap[mappedScraperConfigPerformerTags] = parentMap[mappedScraperConfigPerformerTags]
|
||||
thisMap[mappedScraperConfigPerformerImages] = parentMap[mappedScraperConfigPerformerImages]
|
||||
|
||||
delete(parentMap, mappedScraperConfigPerformerTags)
|
||||
delete(parentMap, mappedScraperConfigPerformerImages)
|
||||
|
||||
// re-unmarshal the sub-fields
|
||||
yml, err := yaml.Marshal(thisMap)
|
||||
|
|
@ -988,6 +993,7 @@ func (s mappedScraper) scrapePerformer(ctx context.Context, q mappedQuery) (*mod
|
|||
}
|
||||
|
||||
performerTagsMap := performerMap.Tags
|
||||
performerImagesMap := performerMap.Images
|
||||
|
||||
results := performerMap.process(ctx, q, s.Common, urlsIsMulti)
|
||||
|
||||
|
|
@ -1003,6 +1009,13 @@ func (s mappedScraper) scrapePerformer(ctx context.Context, q mappedQuery) (*mod
|
|||
}
|
||||
}
|
||||
|
||||
if performerImagesMap != nil {
|
||||
imageResults := performerImagesMap.process(ctx, q, s.Common, nil)
|
||||
for _, p := range imageResults {
|
||||
ret.Images = append(ret.Images, p["URL"].(string))
|
||||
}
|
||||
}
|
||||
|
||||
if len(results) == 0 && len(ret.Tags) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue