Fix scraped performer alias matching (#4432)

This commit is contained in:
DingDongSoLong4 2024-01-08 02:50:31 +02:00 committed by GitHub
parent ea503833c5
commit 910c7025dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 7 deletions

View File

@ -44,22 +44,21 @@ 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 {
// ignore - cannot match
return nil
}
if len(performers) != 1 {
// ignore - cannot match
return nil
}
id := strconv.Itoa(performers[0].ID)