Gallery list improvement (#622)

* Add grid view to galleries
* Show scene in gallery card
* Add is missing scene gallery filter
* Don't store galleries with no images
This commit is contained in:
WithoutPants
2020-06-21 21:43:57 +10:00
committed by GitHub
parent e50f1d01be
commit d3ababf0a1
26 changed files with 296 additions and 35 deletions

View File

@@ -26,7 +26,7 @@ func (t *CleanTask) Start(wg *sync.WaitGroup) {
t.deleteScene(t.Scene.ID)
}
if t.Gallery != nil && t.shouldClean(t.Gallery.Path) {
if t.Gallery != nil && t.shouldCleanGallery(t.Gallery) {
t.deleteGallery(t.Gallery.ID)
}
}
@@ -46,6 +46,19 @@ func (t *CleanTask) shouldClean(path string) bool {
return false
}
func (t *CleanTask) shouldCleanGallery(g *models.Gallery) bool {
if t.shouldClean(g.Path) {
return true
}
if t.Gallery.CountFiles() == 0 {
logger.Infof("Gallery has 0 images. Cleaning: \"%s\"", g.Path)
return true
}
return false
}
func (t *CleanTask) deleteScene(sceneID int) {
ctx := context.TODO()
qb := models.NewSceneQueryBuilder()