mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Add ignore autotag flag (#2439)
* Add autoTagIgnored to database schema * Graphql changes * UI changes * Add field to edit performers dialog * Apply flag to autotag behaviour
This commit is contained in:
@@ -6,6 +6,7 @@ package sqlite_test
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -238,11 +239,31 @@ func TestPerformerIllegalQuery(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestPerformerQueryIgnoreAutoTag(t *testing.T) {
|
||||
withTxn(func(r models.Repository) error {
|
||||
ignoreAutoTag := true
|
||||
performerFilter := models.PerformerFilterType{
|
||||
IgnoreAutoTag: &ignoreAutoTag,
|
||||
}
|
||||
|
||||
sqb := r.Performer()
|
||||
|
||||
performers := queryPerformers(t, sqb, &performerFilter, nil)
|
||||
|
||||
assert.Len(t, performers, int(math.Ceil(float64(totalPerformers)/5)))
|
||||
for _, p := range performers {
|
||||
assert.True(t, p.IgnoreAutoTag)
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func TestPerformerQueryForAutoTag(t *testing.T) {
|
||||
withTxn(func(r models.Repository) error {
|
||||
tqb := r.Performer()
|
||||
|
||||
name := performerNames[performerIdxWithScene] // find a performer by name
|
||||
name := performerNames[performerIdx1WithScene] // find a performer by name
|
||||
|
||||
performers, err := tqb.QueryForAutoTag([]string{name})
|
||||
|
||||
@@ -251,8 +272,8 @@ func TestPerformerQueryForAutoTag(t *testing.T) {
|
||||
}
|
||||
|
||||
assert.Len(t, performers, 2)
|
||||
assert.Equal(t, strings.ToLower(performerNames[performerIdxWithScene]), strings.ToLower(performers[0].Name.String))
|
||||
assert.Equal(t, strings.ToLower(performerNames[performerIdxWithScene]), strings.ToLower(performers[1].Name.String))
|
||||
assert.Equal(t, strings.ToLower(performerNames[performerIdx1WithScene]), strings.ToLower(performers[0].Name.String))
|
||||
assert.Equal(t, strings.ToLower(performerNames[performerIdx1WithScene]), strings.ToLower(performers[1].Name.String))
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user