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:
@@ -182,11 +182,15 @@ func (qb *performerQueryBuilder) QueryForAutoTag(words []string) ([]*models.Perf
|
||||
var whereClauses []string
|
||||
var args []interface{}
|
||||
|
||||
whereClauses = append(whereClauses, "name regexp ?")
|
||||
args = append(args, "^[\\w][.\\-_ ]")
|
||||
|
||||
for _, w := range words {
|
||||
whereClauses = append(whereClauses, "name like ?")
|
||||
args = append(args, w+"%")
|
||||
whereClauses = append(whereClauses, "aliases like ?")
|
||||
args = append(args, w+"%")
|
||||
// TODO - commented out until alias matching works both ways
|
||||
// whereClauses = append(whereClauses, "aliases like ?")
|
||||
// args = append(args, w+"%")
|
||||
}
|
||||
|
||||
where := strings.Join(whereClauses, " OR ")
|
||||
|
||||
Reference in New Issue
Block a user