From e149046272116b3b28c03703feb1e8ad4e6da2d6 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Fri, 14 Aug 2026 19:02:31 -0400 Subject: [PATCH] =?UTF-8?q?Define=20=5Fdur=20on=20the=20arrs=20page=20?= =?UTF-8?q?=E2=80=94=20it=20was=20calling=20a=20function=20that=20does=20n?= =?UTF-8?q?ot=20exist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Plugin/unraid/pages/arrs.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Plugin/unraid/pages/arrs.php b/Plugin/unraid/pages/arrs.php index aeb8695..d01ab3c 100644 --- a/Plugin/unraid/pages/arrs.php +++ b/Plugin/unraid/pages/arrs.php @@ -374,6 +374,18 @@ function _syncSection(sync, recovery, settings) { `; } +// 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