From f106d68921bd78c970db484e3ccf717be4f49357 Mon Sep 17 00:00:00 2001 From: Matthew Daubney Date: Tue, 6 Oct 2026 19:02:53 +0100 Subject: [PATCH] Fix two album art bugs found in manual browser testing - art.js revoked each thumbnail's blob: URL on its own "load" event, but the same URL is shared (via the lookup cache) by every thumbnail for that album on the page - revoking after the first one loaded broke every other still using it. Stop revoking; this is a full-page-reload site, so the browser releases the memory on navigation anyway. - .ranking-art/.log-art thumbnails inherited their row's default cross-axis alignment (baseline for .ranking, stretch for .log), which suits text but left the art sitting high against two-line name+artist text. Center them explicitly instead. Verified in-browser across all four surfaces (song page hero, dashboard Albums ranking, Recently played, History) with real MusicBrainz/Cover Art Archive artwork. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_011Hn2QwS1HRT8tFAzo8ew63 --- frontend/css/style.css | 2 ++ frontend/js/art.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/css/style.css b/frontend/css/style.css index 4b95173..7b6f67d 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -1128,6 +1128,7 @@ input { .ranking-art .art-thumb { width: 2.25rem; height: 2.25rem; + align-self: center; /* .ranking li aligns its other cells to baseline, which suits text, not art */ } .ranking-art .meter { @@ -1146,4 +1147,5 @@ input { .log-art .art-thumb { width: 2.25rem; height: 2.25rem; + align-self: center; /* .log li items default to stretch/start, which suits text, not art */ } diff --git a/frontend/js/art.js b/frontend/js/art.js index 9a0e665..35154fb 100644 --- a/frontend/js/art.js +++ b/frontend/js/art.js @@ -20,8 +20,10 @@ export function artThumb(artist, album, extraClass) { } cache.get(key).then((url) => { if (!url) return; // miss or failed fetch: leave the placeholder + // Not revoked: the same URL is shared by every thumbnail for this album on the page + // (see `cache` above), and this is a full-page-reload site, so the browser releases it + // on navigation anyway. const img = h("img", { class: classes, alt: "", loading: "lazy" }); - img.addEventListener("load", () => URL.revokeObjectURL(url), { once: true }); img.src = url; el.replaceWith(img); });