From acfc51b2d9d351be8488ce121d1f4aa2961cdee2 Mon Sep 17 00:00:00 2001 From: gator Date: Thu, 17 Sep 2026 18:24:19 +0000 Subject: [PATCH] Keep refreshing while the storyboard audio is being prepared The page polls only while it believes something is working, and preparing the reel was not on that list - so the progress froze at whatever the last manual refresh had seen (5/20) while the job ran happily to completion. Also: treat a reel job older than 15 minutes as gone, the way cuts already are, so a worker restart cannot leave the button disabled for ever; and start playing automatically once preparation finishes, since "Prepare and play" promised both. --- trailer.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/trailer.html b/trailer.html index 15b073b..b2f482e 100644 --- a/trailer.html +++ b/trailer.html @@ -179,6 +179,16 @@ return s.writing || s.drawing || s.filming; }); } + // Preparing the storyboard audio is work too. Without this the page stops + // polling and the progress sits at whatever it last happened to see. + function busyReel() { + var st = String(PKG.reel_state || ""); + if (!st || st === "ready" || /^failed/.test(st)) return false; + var t = Date.parse(PKG.reel_started || ""); + if (!t) return true; + return (Date.now() - t) < 15 * 60 * 1000; // older than that is gone + } + async function load() { var r = await api("run_status", { run_id: runId }); if (!r.ok) { showMsg("msg", r.error || "Could not load that run."); return; } @@ -194,7 +204,7 @@ } function tick() { - var busy = DRAFTS.some(busyDraft) || busyRun() || busyShots(); + var busy = DRAFTS.some(busyDraft) || busyRun() || busyShots() || busyReel(); if (busy && !timer) timer = setInterval(refresh, 5000); if (!busy && timer) { clearInterval(timer); timer = null; } }