mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Change scrape matching (studio, movies, tag, performers) to case insensitive (#556)
* Change scrape matching (studio, movies, tag, performers) to case insensitive * * fix collate order * * make filename parser findbyname calls case insensitive * * add unit testing for Tags GetFindbyName/s
This commit is contained in:
@@ -79,8 +79,12 @@ func (qb *StudioQueryBuilder) FindBySceneID(sceneID int) (*Studio, error) {
|
||||
return qb.queryStudio(query, args, nil)
|
||||
}
|
||||
|
||||
func (qb *StudioQueryBuilder) FindByName(name string, tx *sqlx.Tx) (*Studio, error) {
|
||||
query := "SELECT * FROM studios WHERE name = ? LIMIT 1"
|
||||
func (qb *StudioQueryBuilder) FindByName(name string, tx *sqlx.Tx, nocase bool) (*Studio, error) {
|
||||
query := "SELECT * FROM studios WHERE name = ?"
|
||||
if nocase {
|
||||
query += " COLLATE NOCASE"
|
||||
}
|
||||
query += " LIMIT 1"
|
||||
args := []interface{}{name}
|
||||
return qb.queryStudio(query, args, tx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user