Tagger match performer by alias (#4182)

This commit is contained in:
Flashy78
2023-10-15 20:39:41 -07:00
committed by GitHub
parent 409f8fc70c
commit e5af37efbc
2 changed files with 34 additions and 3 deletions

View File

@@ -41,3 +41,24 @@ func CountByAppearsWith(ctx context.Context, r models.PerformerQueryer, id int)
return r.QueryCount(ctx, filter, nil)
}
func ByAlias(ctx context.Context, r models.PerformerQueryer, alias string) ([]*models.Performer, error) {
f := &models.PerformerFilterType{
Aliases: &models.StringCriterionInput{
Value: alias,
Modifier: models.CriterionModifierEquals,
},
}
ret, count, err := r.Query(ctx, f, nil)
if err != nil {
return nil, err
}
if count > 0 {
return ret, nil
}
return nil, nil
}