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.
This commit is contained in:
parent
153c38e6b8
commit
acfc51b2d9
1 changed files with 11 additions and 1 deletions
12
trailer.html
12
trailer.html
|
|
@ -179,6 +179,16 @@
|
||||||
return s.writing || s.drawing || s.filming; });
|
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() {
|
async function load() {
|
||||||
var r = await api("run_status", { run_id: runId });
|
var r = await api("run_status", { run_id: runId });
|
||||||
if (!r.ok) { showMsg("msg", r.error || "Could not load that run."); return; }
|
if (!r.ok) { showMsg("msg", r.error || "Could not load that run."); return; }
|
||||||
|
|
@ -194,7 +204,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function tick() {
|
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) timer = setInterval(refresh, 5000);
|
||||||
if (!busy && timer) { clearInterval(timer); timer = null; }
|
if (!busy && timer) { clearInterval(timer); timer = null; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue