mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Autotag scraper (#1817)
* Refactor scraper structures * Move matching code into new package * Add autotag scraper * Always check first letter of auto-tag names * Account for nulls Co-authored-by: Kermie <kermie@isinthe.house>
This commit is contained in:
@@ -133,6 +133,11 @@ func (qb *studioQueryBuilder) QueryForAutoTag(words []string) ([]*models.Studio,
|
||||
var whereClauses []string
|
||||
var args []interface{}
|
||||
|
||||
// always include names that begin with a single character
|
||||
singleFirstCharacterRegex := "^[\\w][.\\-_ ]"
|
||||
whereClauses = append(whereClauses, "studios.name regexp ? OR COALESCE(studio_aliases.alias, '') regexp ?")
|
||||
args = append(args, singleFirstCharacterRegex, singleFirstCharacterRegex)
|
||||
|
||||
for _, w := range words {
|
||||
ww := w + "%"
|
||||
whereClauses = append(whereClauses, "studios.name like ?")
|
||||
|
||||
Reference in New Issue
Block a user