preview: support skipping over single missing images inside large albums
This commit is contained in:
parent
b146db9d0a
commit
ea1309eb75
19
preview.go
19
preview.go
@ -109,10 +109,29 @@ html, body {
|
||||
m, err := this.Metadata(fileID)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
|
||||
// If this is just one image out of many, show a 404 box and continue to show the other entries
|
||||
// But if this is only a single image requested, abandon the whole pageload
|
||||
|
||||
if len(fileIDs) == 1 {
|
||||
http.Error(w, "Not found", 404)
|
||||
return
|
||||
}
|
||||
|
||||
tmpl += `
|
||||
<div class="entry">
|
||||
<div class="thumbnail">
|
||||
<img loading="lazy" src="/nothumb_340.png"></a>
|
||||
</div>
|
||||
<div class="properties">
|
||||
Requested ID ` + html.EscapeString(fileID) + ` not found in storage (404)
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
log.Println(err.Error())
|
||||
http.Error(w, "Internal error", 500)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user