mirror of
https://github.com/stashapp/stash.git
synced 2026-04-11 20:32:55 -05:00
* Add tagStore.FindByAlias method * Change tag.ByName and ByAlias to use exact queries instead of fuzzy matching
30 lines
522 B
Go
30 lines
522 B
Go
package tag
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/stashapp/stash/pkg/models"
|
|
)
|
|
|
|
func ByName(ctx context.Context, qb models.TagNameFinder, name string) (*models.Tag, error) {
|
|
const nocase = true
|
|
ret, err := qb.FindByName(ctx, name, nocase)
|
|
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return ret, nil
|
|
}
|
|
|
|
func ByAlias(ctx context.Context, qb models.TagNameFinder, alias string) (*models.Tag, error) {
|
|
const nocase = true
|
|
ret, err := qb.FindByAlias(ctx, alias, nocase)
|
|
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return ret, nil
|
|
}
|