Video thumbnail generation

This commit is contained in:
2026-06-24 08:36:03 +02:00
parent fa22244709
commit 9f6a611dff
5 changed files with 216 additions and 23 deletions
+4
View File
@@ -36,6 +36,9 @@ type entry struct {
// ThumbURL is set for thumbnailable files; the thumbnail view renders an
// <img> when it is non-empty and falls back to Icon otherwise.
ThumbURL string
// IsVideo marks a thumbnail tile as a video so the grid can overlay a play
// badge. Only meaningful when ThumbURL is set.
IsVideo bool
// modTime/size carry the raw sort keys; the template only reads the
// formatted Meta string.
modTime time.Time
@@ -217,6 +220,7 @@ func listEntries(fsPath, urlPath, sortKey, order string) []entry {
}
if hasThumbnail(name) {
f.ThumbURL = thumbURL(path.Join(urlPath, url.PathEscape(name)), 300)
f.IsVideo = isVideoFile(name)
}
files = append(files, f)
}