Handle unicode characters in autotag (#2336)

This commit is contained in:
WithoutPants
2022-02-28 13:12:43 +11:00
committed by GitHub
parent c5c94e783e
commit 1ab5be162e
6 changed files with 41 additions and 11 deletions

View File

@@ -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 ?")