Add gallery admin and video media support.
This updates gallery handling to support video playback with generated poster thumbnails, adds authenticated admin upload/delete flows, and improves dev/runtime behavior including reliable thumbnail generation and media-safe response handling. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -19,12 +19,17 @@ func HeroRelPath() string {
|
||||
func SelectHero(images []Image) (Image, bool) {
|
||||
want := HeroRelPath()
|
||||
for _, img := range images {
|
||||
if img.IsVideo {
|
||||
continue
|
||||
}
|
||||
if img.RelPath == want {
|
||||
return img, true
|
||||
}
|
||||
}
|
||||
if len(images) > 0 {
|
||||
return images[0], true
|
||||
for _, img := range images {
|
||||
if !img.IsVideo {
|
||||
return img, true
|
||||
}
|
||||
}
|
||||
return Image{}, false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user