Add a cache for gallery thumbnails (#496)

This commit is contained in:
bnkai
2020-05-11 10:20:08 +03:00
committed by GitHub
parent 8ba76783b0
commit bd45daacf3
36 changed files with 319 additions and 1200 deletions

View File

@@ -34,11 +34,16 @@ func (t *ScanTask) Start(wg *sync.WaitGroup) {
func (t *ScanTask) scanGallery() {
qb := models.NewGalleryQueryBuilder()
gallery, _ := qb.FindByPath(t.FilePath)
if gallery != nil {
// We already have this item in the database, keep going
return
}
ok, err := utils.IsZipFileUncompressed(t.FilePath)
if err == nil && !ok {
logger.Warnf("%s is using above store (0) level compression.", t.FilePath)
}
checksum, err := t.calculateChecksum()
if err != nil {
logger.Error(err.Error())