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:
WithoutPants
2020-10-20 10:11:15 +11:00
committed by GitHub
parent 80199f79f3
commit 8eda72ad89
31 changed files with 463 additions and 169 deletions

View File

@@ -106,6 +106,34 @@ func imageQueryQ(t *testing.T, sqb models.ImageQueryBuilder, q string, expectedI
assert.Len(t, images, totalImages)
}
func TestImageQueryPath(t *testing.T) {
const imageIdx = 1
imagePath := getImageStringValue(imageIdx, "Path")
pathCriterion := models.StringCriterionInput{
Value: imagePath,
Modifier: models.CriterionModifierEquals,
}
verifyImagePath(t, pathCriterion)
pathCriterion.Modifier = models.CriterionModifierNotEquals
verifyImagePath(t, pathCriterion)
}
func verifyImagePath(t *testing.T, pathCriterion models.StringCriterionInput) {
sqb := models.NewImageQueryBuilder()
imageFilter := models.ImageFilterType{
Path: &pathCriterion,
}
images, _ := sqb.Query(&imageFilter, nil)
for _, image := range images {
verifyString(t, image.Path, pathCriterion)
}
}
func TestImageQueryRating(t *testing.T) {
const rating = 3
ratingCriterion := models.IntCriterionInput{