Fix joined hierarchical filtering (#3775)

* Fix joined hierarchical filtering
* Fix scene performer tag filter
* Generalise performer tag handler
* Add unit tests
* Add equals handling
* Make performer tags equals/not equals unsupported
* Make tags not equals unsupported
* Make not equals unsupported for performers criterion
* Support equals/not equals for studio criterion
* Fix marker scene tags equals filter
* Fix scene performer tag filter
* Make equals/not equals unsupported for hierarchical criterion
* Use existing studio handler in movie
* Hide unsupported tag modifier options
* Use existing performer tags logic where possible
* Restore old parent/child filter logic
* Disable sub-tags in equals modifier for tags criterion
This commit is contained in:
WithoutPants
2023-06-06 13:01:50 +10:00
committed by GitHub
parent 4acf843229
commit 256e0a11ea
19 changed files with 2153 additions and 938 deletions

View File

@@ -513,12 +513,13 @@ func Test_PerformerStore_UpdatePartial(t *testing.T) {
performerIDs[performerIdxWithTwoTags],
clearPerformerPartial(),
models.Performer{
ID: performerIDs[performerIdxWithTwoTags],
Name: getPerformerStringValue(performerIdxWithTwoTags, "Name"),
Favorite: true,
Aliases: models.NewRelatedStrings([]string{}),
TagIDs: models.NewRelatedIDs([]int{}),
StashIDs: models.NewRelatedStashIDs([]models.StashID{}),
ID: performerIDs[performerIdxWithTwoTags],
Name: getPerformerStringValue(performerIdxWithTwoTags, "Name"),
Favorite: getPerformerBoolValue(performerIdxWithTwoTags),
Aliases: models.NewRelatedStrings([]string{}),
TagIDs: models.NewRelatedIDs([]int{}),
StashIDs: models.NewRelatedStashIDs([]models.StashID{}),
IgnoreAutoTag: getIgnoreAutoTag(performerIdxWithTwoTags),
},
false,
},
@@ -1904,10 +1905,10 @@ func TestPerformerQuerySortScenesCount(t *testing.T) {
assert.True(t, len(performers) > 0)
// first performer should be performerIdxWithTwoScenes
// first performer should be performerIdx1WithScene
firstPerformer := performers[0]
assert.Equal(t, performerIDs[performerIdxWithTwoScenes], firstPerformer.ID)
assert.Equal(t, performerIDs[performerIdx1WithScene], firstPerformer.ID)
// sort in ascending order
direction = models.SortDirectionEnumAsc
@@ -1920,7 +1921,7 @@ func TestPerformerQuerySortScenesCount(t *testing.T) {
assert.True(t, len(performers) > 0)
lastPerformer := performers[len(performers)-1]
assert.Equal(t, performerIDs[performerIdxWithTwoScenes], lastPerformer.ID)
assert.Equal(t, performerIDs[performerIdxWithTag], lastPerformer.ID)
return nil
})
@@ -2060,7 +2061,7 @@ func TestPerformerStore_FindByStashIDStatus(t *testing.T) {
name: "!hasStashID",
hasStashID: false,
stashboxEndpoint: getPerformerStringValue(performerIdxWithScene, "endpoint"),
include: []int{performerIdxWithImage},
include: []int{performerIdxWithTwoScenes},
exclude: []int{performerIdx2WithScene},
wantErr: false,
},