fix: backfill posters for ALL history entries; skip <img> when no poster

- backfill script deduped by slug_id, so a second entry for the same
  anime kept no poster -> rendered as a broken <img src="">
- re-backfilled from the already-fetched poster per slug
- showHome now only emits an <img> when the entry has a poster
This commit is contained in:
jozamudi committed 2026-08-19 17:32:58 +00:00
1 parent 2b7eb4cdd1
commit 0a86e70a54
1 file changed
+8 -3
+8 -3
View File
@@ -76,8 +76,10 @@ function showHome() {
const sec = el("section", "hero-sec");
const card = el("a", "hero");
card.href = histHref(hero);
const img = el("img"); img.src = hero.poster || ""; img.alt = "";
if (hero.poster) {
const img = el("img"); img.src = hero.poster; img.alt = "";
card.append(img);
}
const right = el("div", "right");
const body = el("div", "hero-body");
body.append(el("div", "hero-kicker", "continue watching"),
@@ -97,7 +99,10 @@ function showHome() {
for (const x of history.slice(1, 6)) {
const c = el("a", "card");
c.href = histHref(x);
const i = el("img"); i.src = x.poster || ""; i.alt = "";
if (x.poster) {
const i = el("img"); i.src = x.poster; i.alt = "";
c.append(i);
}
const info = el("div", "mini-info");
info.append(el("div", "card-name", x.title));
const meta = el("div", "mini-meta");
@@ -105,7 +110,7 @@ function showHome() {
info.append(meta);
const pb = bar(x, "small");
if (pb) info.append(pb);
c.append(i, info);
c.append(info);
grid.append(c);
}
main.append(grid);