fix(artwork): log why a sized cover fell back to the placeholder

serveHash routed every non-cancel cache error into dangling(), which returns
ErrUnavailable and is then rendered as a placeholder at 200 OK. A cache-layer
fault was therefore indistinguishable from an album genuinely having no artwork,
and left no trace: a broken resize cache silently served placeholders for a
quarter of the library while the logs stayed clean.

Log the error before falling back, so the cause is recoverable from the logs.
This commit is contained in:
Deluan 2026-07-26 01:07:39 -04:00
parent cabbbc0ced
commit de2b2e4b78

View File

@ -142,6 +142,7 @@ func (s *service) serveHash(ctx context.Context, artID model.ArtworkID, ia *mode
if errors.Is(err, context.Canceled) {
return nil, err
}
log.Warn(ctx, "artwork: could not serve resized image", "artID", artID, "size", size, err)
return s.dangling(ctx, artID)
}
return &Image{ReadCloser: stream, Hash: ia.Hash, ETag: representationTag(ia.Hash, size, square), LastUpdated: ia.UpdatedAt}, nil