From 173e24a36240670ec9c5ff7b1717c50e79f2e44e Mon Sep 17 00:00:00 2001 From: Steppenstreuner Date: Sun, 25 Oct 2026 20:32:48 +0100 Subject: [PATCH] feat(ui): load request covers through the local cache --- static/app.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/static/app.js b/static/app.js index c346d13..ecc2287 100644 --- a/static/app.js +++ b/static/app.js @@ -81,6 +81,11 @@ function libOptions(mediaType) { .join(""); } +// the server keeps a copy; the url in the query makes a changed cover a new address +function coverSrc(r) { + return `/api/requests/${r.id}/cover?u=${encodeURIComponent(r.cover_url)}`; +} + // ---- missing badge ---- async function refreshMissingBadge() { try { @@ -609,7 +614,7 @@ function renderRequests(status) { box.innerHTML = reqs .map( (r) => `
- ${r.cover_url ? `` : '
?
'} + ${r.cover_url ? `` : '
?
'}
${esc(r.title)}${r.volume != null ? ` ยท ${t("common.volume")} ${r.volume}` : ""} ${esc(r.authors)} @@ -888,7 +893,7 @@ function openDetail(id, status) { const img = $("#detail-cover"); img.hidden = !r.cover_url; $("#detail-nocover").hidden = !!r.cover_url; - if (r.cover_url) img.src = r.cover_url; + if (r.cover_url) img.src = coverSrc(r); $("#detail-retag").hidden = !(r.status === "imported" && r.media_type === "audiobook"); $("#detail-relocate").hidden = r.status !== "imported"; $("#detail-dialog").showModal();