From b146db9d0a7b9ce9f8781b6596d262702bf1e8de Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 20 May 2023 13:43:17 +1200 Subject: [PATCH] preview: add minimal preview for albums with no images --- preview.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/preview.go b/preview.go index 9fbcf3b..ba9f76f 100644 --- a/preview.go +++ b/preview.go @@ -136,16 +136,15 @@ html, body { return } - if len(childIDs) == 0 { - log.Printf("Failed to parse album '%s': no entries in album", fileID) - http.Error(w, "Internal error", 500) - return + albumThumb := `/nothumb_340.png` + if len(childIDs) > 0 { + albumThumb = `/thumb/m/` + childIDs[0] } tmpl += `
- +
` + fmt.Sprintf("%d", len(childIDs)) + ` image(s)