mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
Fix scraped performer alias matching (#4432)
This commit is contained in:
parent
ea503833c5
commit
910c7025dc
1 changed files with 6 additions and 7 deletions
|
|
@ -44,23 +44,22 @@ func ScrapedPerformer(ctx context.Context, qb PerformerFinder, p *models.Scraped
|
||||||
}
|
}
|
||||||
|
|
||||||
performers, err := qb.FindByNames(ctx, []string{*p.Name}, true)
|
performers, err := qb.FindByNames(ctx, []string{*p.Name}, true)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if performers == nil || len(performers) != 1 {
|
if len(performers) == 0 {
|
||||||
// try matching a single performer by exact alias
|
// if no names matched, try match an exact alias
|
||||||
performers, err = performer.ByAlias(ctx, qb, *p.Name)
|
performers, err = performer.ByAlias(ctx, qb, *p.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if performers == nil || len(performers) != 1 {
|
if len(performers) != 1 {
|
||||||
// ignore - cannot match
|
// ignore - cannot match
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
id := strconv.Itoa(performers[0].ID)
|
id := strconv.Itoa(performers[0].ID)
|
||||||
p.StoredID = &id
|
p.StoredID = &id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue