mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Handle auto-tagging where filename has no whitespace in name (#1488)
This commit is contained in:
@@ -87,7 +87,13 @@ func getPathWords(path string) []string {
|
||||
var ret []string
|
||||
for _, w := range words {
|
||||
if len(w) > 1 {
|
||||
ret = append(ret, w)
|
||||
// #1450 - we need to open up the criteria for matching so that we
|
||||
// can match where path has no space between subject names -
|
||||
// ie name = "foo bar" - path = "foobar"
|
||||
// we post-match afterwards, so we can afford to be a little loose
|
||||
// with the query
|
||||
// just use the first two characters
|
||||
ret = append(ret, w[0:2])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -185,9 +185,9 @@ func (qb *performerQueryBuilder) QueryForAutoTag(words []string) ([]*models.Perf
|
||||
|
||||
for _, w := range words {
|
||||
whereClauses = append(whereClauses, "name like ?")
|
||||
args = append(args, "%"+w+"%")
|
||||
args = append(args, w+"%")
|
||||
whereClauses = append(whereClauses, "aliases like ?")
|
||||
args = append(args, "%"+w+"%")
|
||||
args = append(args, w+"%")
|
||||
}
|
||||
|
||||
where := strings.Join(whereClauses, " OR ")
|
||||
|
||||
@@ -132,7 +132,7 @@ func (qb *studioQueryBuilder) QueryForAutoTag(words []string) ([]*models.Studio,
|
||||
|
||||
for _, w := range words {
|
||||
whereClauses = append(whereClauses, "name like ?")
|
||||
args = append(args, "%"+w+"%")
|
||||
args = append(args, w+"%")
|
||||
}
|
||||
|
||||
where := strings.Join(whereClauses, " OR ")
|
||||
|
||||
@@ -214,7 +214,7 @@ func (qb *tagQueryBuilder) QueryForAutoTag(words []string) ([]*models.Tag, error
|
||||
var args []interface{}
|
||||
|
||||
for _, w := range words {
|
||||
ww := "%" + w + "%"
|
||||
ww := w + "%"
|
||||
whereClauses = append(whereClauses, "tags.name like ?")
|
||||
args = append(args, ww)
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* Add button to remove studio stash ID. ([#1378](https://github.com/stashapp/stash/pull/1378))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
* Fix auto-tagger not tagging scenes with no whitespace in name. ([#1488](https://github.com/stashapp/stash/pull/1488))
|
||||
* Fix click/drag to select scenes. ([#1476](https://github.com/stashapp/stash/pull/1476))
|
||||
* Fix clearing Performer and Movie ratings not working. ([#1429](https://github.com/stashapp/stash/pull/1429))
|
||||
* Fix scraper date parser failing when parsing time. ([#1431](https://github.com/stashapp/stash/pull/1431))
|
||||
|
||||
Reference in New Issue
Block a user