From a3a58e7d3cd48f3fd1c22c80d3de9d763fec23a1 Mon Sep 17 00:00:00 2001 From: Josue Zamudio Date: Wed, 19 Aug 2026 15:18:14 +0000 Subject: [PATCH] ui: no-store cache headers, synopsis below episode grid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - no-store on everything except /stream: stale cached app.js (old CDN hls.js ref) was the cause of the black screen — video plays fine in a real Chromium once the fresh JS loads (verified via playwright) - synopsis moved under the episode grid --- app.py | 9 +++++++++ static/app.js | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 46ae36b..62f7f82 100644 --- a/app.py +++ b/app.py @@ -33,6 +33,15 @@ def _upstream(fn, *a, **kw): raise HTTPException(502, f"upstream error: {e}") +@app.middleware("http") +async def no_cache(request, call_next): + # ponytail: no-store on everything except /stream (segments should cache) + r = await call_next(request) + if not request.url.path.startswith("/stream"): + r.headers["Cache-Control"] = "no-store" + return r + + @app.get("/api/search") def api_search(q: str = Query(min_length=1)): return _upstream(upstream.search, q) diff --git a/static/app.js b/static/app.js index 814900e..e1cd2e5 100644 --- a/static/app.js +++ b/static/app.js @@ -79,7 +79,7 @@ async function showAnime(slug_id, opts = {}) { main.innerHTML = ""; const head = el("section", "detail-head"); - head.append(el("h2", null, detail.name), el("p", "synopsis", detail.synopsis || "")); + head.append(el("h2", null, detail.name)); main.append(head); const player = el("div", "player"); @@ -127,6 +127,8 @@ async function showAnime(slug_id, opts = {}) { const cur = [...eps.children].find(b => +b.dataset.ep === opts.ep); if (cur) { markActive(cur); play(opts.ep, cur.dataset.no); } } + + if (detail.synopsis) main.append(el("p", "synopsis bottom", detail.synopsis)); } function langLabel() { return lang === "eng" ? "▶ dub" : "▶ sub"; }