mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Add related object filter criteria to various filter types in graphql schema (#4861)
* Move filter criterion handlers into separate file * Add related filters for image filter * Add related filters for scene filter * Add related filters to gallery filter * Add related filters to movie filter * Add related filters to performer filter * Add related filters to studio filter * Add related filters to tag filter * Add scene filter to scene marker filter
This commit is contained in:
@@ -1534,10 +1534,12 @@ func TestGalleryQueryPathOr(t *testing.T) {
|
||||
Value: gallery1Path,
|
||||
Modifier: models.CriterionModifierEquals,
|
||||
},
|
||||
Or: &models.GalleryFilterType{
|
||||
Path: &models.StringCriterionInput{
|
||||
Value: gallery2Path,
|
||||
Modifier: models.CriterionModifierEquals,
|
||||
OperatorFilter: models.OperatorFilter[models.GalleryFilterType]{
|
||||
Or: &models.GalleryFilterType{
|
||||
Path: &models.StringCriterionInput{
|
||||
Value: gallery2Path,
|
||||
Modifier: models.CriterionModifierEquals,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1568,10 +1570,12 @@ func TestGalleryQueryPathAndRating(t *testing.T) {
|
||||
Value: galleryPath,
|
||||
Modifier: models.CriterionModifierEquals,
|
||||
},
|
||||
And: &models.GalleryFilterType{
|
||||
Rating100: &models.IntCriterionInput{
|
||||
Value: *galleryRating,
|
||||
Modifier: models.CriterionModifierEquals,
|
||||
OperatorFilter: models.OperatorFilter[models.GalleryFilterType]{
|
||||
And: &models.GalleryFilterType{
|
||||
Rating100: &models.IntCriterionInput{
|
||||
Value: *galleryRating,
|
||||
Modifier: models.CriterionModifierEquals,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1609,8 +1613,10 @@ func TestGalleryQueryPathNotRating(t *testing.T) {
|
||||
|
||||
galleryFilter := models.GalleryFilterType{
|
||||
Path: &pathCriterion,
|
||||
Not: &models.GalleryFilterType{
|
||||
Rating100: &ratingCriterion,
|
||||
OperatorFilter: models.OperatorFilter[models.GalleryFilterType]{
|
||||
Not: &models.GalleryFilterType{
|
||||
Rating100: &ratingCriterion,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1641,8 +1647,10 @@ func TestGalleryIllegalQuery(t *testing.T) {
|
||||
}
|
||||
|
||||
galleryFilter := &models.GalleryFilterType{
|
||||
And: &subFilter,
|
||||
Or: &subFilter,
|
||||
OperatorFilter: models.OperatorFilter[models.GalleryFilterType]{
|
||||
And: &subFilter,
|
||||
Or: &subFilter,
|
||||
},
|
||||
}
|
||||
|
||||
withTxn(func(ctx context.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user