This commit is contained in:
SuperMudkip 2025-12-04 03:04:27 +02:00 committed by GitHub
commit e32fbad3e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}