mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user