mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Image improvements (#847)
* Fix image performer filtering * Add performer images tab * Add studio images tab * Rename interface * Add tag images tab * Add path filtering for images * Show image stats on stats page * Fix incorrect scan counts after timeout * Add gallery filters * Relax scene gallery selector
This commit is contained in:
@@ -153,6 +153,44 @@ func verifyGalleriesPath(t *testing.T, pathCriterion models.StringCriterionInput
|
||||
}
|
||||
}
|
||||
|
||||
func TestGalleryQueryRating(t *testing.T) {
|
||||
const rating = 3
|
||||
ratingCriterion := models.IntCriterionInput{
|
||||
Value: rating,
|
||||
Modifier: models.CriterionModifierEquals,
|
||||
}
|
||||
|
||||
verifyGalleriesRating(t, ratingCriterion)
|
||||
|
||||
ratingCriterion.Modifier = models.CriterionModifierNotEquals
|
||||
verifyGalleriesRating(t, ratingCriterion)
|
||||
|
||||
ratingCriterion.Modifier = models.CriterionModifierGreaterThan
|
||||
verifyGalleriesRating(t, ratingCriterion)
|
||||
|
||||
ratingCriterion.Modifier = models.CriterionModifierLessThan
|
||||
verifyGalleriesRating(t, ratingCriterion)
|
||||
|
||||
ratingCriterion.Modifier = models.CriterionModifierIsNull
|
||||
verifyGalleriesRating(t, ratingCriterion)
|
||||
|
||||
ratingCriterion.Modifier = models.CriterionModifierNotNull
|
||||
verifyGalleriesRating(t, ratingCriterion)
|
||||
}
|
||||
|
||||
func verifyGalleriesRating(t *testing.T, ratingCriterion models.IntCriterionInput) {
|
||||
sqb := models.NewGalleryQueryBuilder()
|
||||
galleryFilter := models.GalleryFilterType{
|
||||
Rating: &ratingCriterion,
|
||||
}
|
||||
|
||||
galleries, _ := sqb.Query(&galleryFilter, nil)
|
||||
|
||||
for _, gallery := range galleries {
|
||||
verifyInt64(t, gallery.Rating, ratingCriterion)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGalleryQueryIsMissingScene(t *testing.T) {
|
||||
qb := models.NewGalleryQueryBuilder()
|
||||
isMissing := "scene"
|
||||
|
||||
Reference in New Issue
Block a user