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