INNER CODE UNIT · JavaScript
syncExtractorScope
LeyckerS/moondownloader · web/app.js:394
function syncExtractorScope() {
const hint = $("#extractorScope");
const workers = $("#workers");
const pages = $("#pages");
if (!hint || !workers || !pages) return;
const workerCount = Number(workers.value);
const pageCount = Number(pages.value);
hint.textContent = T("extractors_hint", Math.min(workerCount, pageCount), pageCount);
}
/* ── run state ────────────────────────────────────────────────────────── */
function setRunState(state) {
// applyLang() calls this with the state it already has, to relabel; comparing
// first is what keeps that from re-firing the end-of-run panel.
const prev = ui.runState;
ui.runState = state;
const pillKey = { idle: "IDLE", running: "RUNNING", stopping: "STOPPING", done: "DONE" }[state] || "IDLE";
const btnKey = { idle: "start", running: "stop", stopping: "stopping", done: "start" }[state] || "start";