Images section (#813)

* Add new configuration options
* Refactor scan/clean
* Schema changes
* Add details to galleries
* Remove redundant code
* Refine thumbnail generation
* Gallery overhaul
* Don't allow modifying zip gallery images
* Show gallery card overlays
* Hide zoom slider when not in grid mode
This commit is contained in:
WithoutPants
2020-10-13 10:12:46 +11:00
committed by GitHub
parent df3252e24f
commit aca2c7c5f4
147 changed files with 12483 additions and 946 deletions

View File

@@ -14,15 +14,15 @@ func TestGalleryFind(t *testing.T) {
gqb := models.NewGalleryQueryBuilder()
const galleryIdx = 0
gallery, err := gqb.Find(galleryIDs[galleryIdx])
gallery, err := gqb.Find(galleryIDs[galleryIdx], nil)
if err != nil {
t.Fatalf("Error finding gallery: %s", err.Error())
}
assert.Equal(t, getGalleryStringValue(galleryIdx, "Path"), gallery.Path)
assert.Equal(t, getGalleryStringValue(galleryIdx, "Path"), gallery.Path.String)
gallery, err = gqb.Find(0)
gallery, err = gqb.Find(0, nil)
if err != nil {
t.Fatalf("Error finding gallery: %s", err.Error())
@@ -42,7 +42,7 @@ func TestGalleryFindByChecksum(t *testing.T) {
t.Fatalf("Error finding gallery: %s", err.Error())
}
assert.Equal(t, getGalleryStringValue(galleryIdx, "Path"), gallery.Path)
assert.Equal(t, getGalleryStringValue(galleryIdx, "Path"), gallery.Path.String)
galleryChecksum = "not exist"
gallery, err = gqb.FindByChecksum(galleryChecksum, nil)
@@ -65,7 +65,7 @@ func TestGalleryFindByPath(t *testing.T) {
t.Fatalf("Error finding gallery: %s", err.Error())
}
assert.Equal(t, galleryPath, gallery.Path)
assert.Equal(t, galleryPath, gallery.Path.String)
galleryPath = "not exist"
gallery, err = gqb.FindByPath(galleryPath)
@@ -87,7 +87,7 @@ func TestGalleryFindBySceneID(t *testing.T) {
t.Fatalf("Error finding gallery: %s", err.Error())
}
assert.Equal(t, getGalleryStringValue(galleryIdxWithScene, "Path"), gallery.Path)
assert.Equal(t, getGalleryStringValue(galleryIdxWithScene, "Path"), gallery.Path.String)
gallery, err = gqb.FindBySceneID(0, nil)
@@ -149,7 +149,7 @@ func verifyGalleriesPath(t *testing.T, pathCriterion models.StringCriterionInput
galleries, _ := sqb.Query(&galleryFilter, nil)
for _, gallery := range galleries {
verifyString(t, gallery.Path, pathCriterion)
verifyNullString(t, gallery.Path, pathCriterion)
}
}