Tag aliases (#1412)

* Add Tag Update/UpdateFull
* Tag alias implementation
* Refactor tag page
* Add aliases in UI
* Include tag aliases in q filter
* Include aliases in tag select
* Add aliases to auto-tagger
* Use aliases in scraper
* Add tag aliases for filename parser
This commit is contained in:
WithoutPants
2021-05-26 14:36:05 +10:00
committed by GitHub
parent 9b57fbbf50
commit c70faa2a53
48 changed files with 1303 additions and 315 deletions

View File

@@ -10,6 +10,7 @@ import (
"time"
"github.com/stashapp/stash/pkg/models"
"github.com/stashapp/stash/pkg/tag"
"github.com/jmoiron/sqlx"
)
@@ -583,7 +584,7 @@ func (p *SceneFilenameParser) queryMovie(qb models.MovieReader, movieName string
}
func (p *SceneFilenameParser) queryTag(qb models.TagReader, tagName string) *models.Tag {
// massage the performer name
// massage the tag name
tagName = delimiterRE.ReplaceAllString(tagName, " ")
// check cache first
@@ -592,7 +593,12 @@ func (p *SceneFilenameParser) queryTag(qb models.TagReader, tagName string) *mod
}
// match tag name exactly
ret, _ := qb.FindByName(tagName, true)
ret, _ := tag.ByName(qb, tagName)
// try to match on alias
if ret == nil {
ret, _ = tag.ByAlias(qb, tagName)
}
// add result to cache
p.tagCache[tagName] = ret