mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Handle unicode characters in autotag (#2336)
This commit is contained in:
@@ -21,6 +21,8 @@ WHERE performers_tags.tag_id = ?
|
||||
GROUP BY performers_tags.performer_id
|
||||
`
|
||||
|
||||
const singleFirstCharacterRegex = `^[\w\p{L}][.\-_ ]`
|
||||
|
||||
type performerQueryBuilder struct {
|
||||
repository
|
||||
}
|
||||
@@ -184,7 +186,7 @@ func (qb *performerQueryBuilder) QueryForAutoTag(words []string) ([]*models.Perf
|
||||
var args []interface{}
|
||||
|
||||
whereClauses = append(whereClauses, "name regexp ?")
|
||||
args = append(args, "^[\\w][.\\-_ ]")
|
||||
args = append(args, singleFirstCharacterRegex)
|
||||
|
||||
for _, w := range words {
|
||||
whereClauses = append(whereClauses, "name like ?")
|
||||
|
||||
Reference in New Issue
Block a user