ui: no-store cache headers, synopsis below episode grid
- 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
This commit is contained in:
1 parent
6c752ae5bc
commit
a3a58e7d3c
2 files changed
+12
-1
No files matched your search
@@ -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)
|
||||
|
||||
+3
-1
@@ -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"; }
|
||||
|
||||
Reference in new issue
Block a user