From 910c7025dc88f24317dfe12844be65507a9b72f9 Mon Sep 17 00:00:00 2001 From: DingDongSoLong4 <99329275+DingDongSoLong4@users.noreply.github.com> Date: Mon, 8 Jan 2024 02:50:31 +0200 Subject: [PATCH] Fix scraped performer alias matching (#4432) --- pkg/match/scraped.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/match/scraped.go b/pkg/match/scraped.go index 012cb7495..0b8a8d696 100644 --- a/pkg/match/scraped.go +++ b/pkg/match/scraped.go @@ -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)