Video thumbnail generation
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user