Auto tag rewrite (#1324)

This commit is contained in:
WithoutPants
2021-04-26 12:51:31 +10:00
committed by GitHub
parent f66010a367
commit 2eb2d865dc
26 changed files with 1469 additions and 370 deletions

View File

@@ -100,6 +100,26 @@ func TestPerformerFindByNames(t *testing.T) {
})
}
func TestPerformerQueryForAutoTag(t *testing.T) {
withTxn(func(r models.Repository) error {
tqb := r.Performer()
name := performerNames[performerIdxWithScene] // find a performer by name
performers, err := tqb.QueryForAutoTag([]string{name})
if err != nil {
t.Errorf("Error finding performers: %s", err.Error())
}
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))
return nil
})
}
func TestPerformerUpdatePerformerImage(t *testing.T) {
if err := withTxn(func(r models.Repository) error {
qb := r.Performer()