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

@@ -64,7 +64,6 @@ func (t *ScanTask) scanGallery() {
_, err = qb.Update(*gallery, tx)
}
} else {
logger.Infof("%s doesn't exist. Creating new item...", t.FilePath)
currentTime := time.Now()
newGallery := models.Gallery{
@@ -73,7 +72,12 @@ func (t *ScanTask) scanGallery() {
CreatedAt: models.SQLiteTimestamp{Timestamp: currentTime},
UpdatedAt: models.SQLiteTimestamp{Timestamp: currentTime},
}
_, err = qb.Create(newGallery, tx)
// don't create gallery if it has no images
if newGallery.CountFiles() > 0 {
logger.Infof("%s doesn't exist. Creating new item...", t.FilePath)
_, err = qb.Create(newGallery, tx)
}
}
if err != nil {