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();