mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Tagger match performer by alias (#4182)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user