Skip to content

Commit

Permalink
Fix scraped performer alias matching (stashapp#4432)
Browse files Browse the repository at this point in the history
  • Loading branch information
DingDongSoLong4 authored and halkeye committed Sep 1, 2024
1 parent 1f7bc17 commit ab1c513
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/match/scraped.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ab1c513

Please sign in to comment.