mirror of
https://github.com/stashapp/stash.git
synced 2026-04-17 04:24:07 +02:00
Simplify name matching code
This commit is contained in:
parent
a690d0aa3f
commit
6f61de3dbb
1 changed files with 3 additions and 7 deletions
|
|
@ -637,16 +637,12 @@ func (t *stashBoxBatchTagTagTask) findStashBoxTag(ctx context.Context) (*models.
|
|||
|
||||
// QueryTag returns tags that partially match the name, so find the exact match if searching by name
|
||||
if nameQuery != "" {
|
||||
var exactMatch *models.ScrapedTag
|
||||
for _, result := range results {
|
||||
if strings.EqualFold(result.Name, nameQuery) {
|
||||
exactMatch = result
|
||||
for _, r := range results {
|
||||
if strings.EqualFold(r.Name, nameQuery) {
|
||||
result = r
|
||||
break
|
||||
}
|
||||
}
|
||||
if exactMatch != nil {
|
||||
result = exactMatch
|
||||
}
|
||||
} else {
|
||||
result = results[0]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue