Skip to content

Commit

Permalink
fix: add check for thumbnail generation configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
PlusOne committed Dec 31, 2024
1 parent 8e5c42b commit a613196
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2838,6 +2838,10 @@ func generateThumbnail(originalPath, size string) error {
return nil
}

if (!conf.Thumbnails.Enabled) {
return nil
}

// Check if the file is an image
if !isImageFile(originalPath) {
log.Infof("File %s is not an image. Skipping thumbnail generation.", originalPath)
Expand Down Expand Up @@ -3170,7 +3174,6 @@ func verifyAndRepairThumbnails(thumbnailPaths []string, redisClient *redis.Clien
log.Warnf("Error storing new hash for thumbnail %s in Redis: %v", thumbPath, err)
continue
}

log.Infof("Successfully regenerated and updated thumbnail %s", thumbPath)
}
}
Expand Down

0 comments on commit a613196

Please sign in to comment.