Define _dur on the arrs page — it was calling a function that does not exist
The media jobs row I just added formats durations with _dur(), which the rsync page defines locally and js/varaverk.js does not export at all. The reference threw inside _render(), the fetch's catch reported it as "Error loading arrs status", and the whole page went blank — nothing to do with the API, which was returning valid JSON throughout.
This commit is contained in:
@@ -374,6 +374,18 @@ function _syncSection(sync, recovery, settings) {
|
||||
</div>`;
|
||||
}
|
||||
|
||||
// Local, because there is no global one. js/varaverk.js provides _relTime, _sz, _n and _uptime —
|
||||
// and _uptime floors to whole minutes, so a 33-second cleanup would render as "0m". Same shape the
|
||||
// rsync page uses for the same reason; if a third page needs it, that is the point to promote it
|
||||
// to the shared file rather than keep a third copy.
|
||||
function _dur(s) {
|
||||
if (!s) return '—';
|
||||
const h = Math.floor(s / 3600), m = Math.floor((s % 3600) / 60), sec = s % 60;
|
||||
if (h) return h + 'h ' + m + 'm';
|
||||
if (m) return m + 'm ' + sec + 's';
|
||||
return sec + 's';
|
||||
}
|
||||
|
||||
// ── Media jobs ────────────────────────────────────────────────────────────────
|
||||
// Play state sync, permissions and the cleaner. They work on the same files the arrs manage and
|
||||
// appeared in no tab at all — the only way to know whether one had run was to open the Scheduler
|
||||
|
||||
Reference in New Issue
Block a user