From a562cfe9aa137e8720ce1ab7e7bbf7d8f8960dbb Mon Sep 17 00:00:00 2001 From: Gronod Date: Wed, 20 May 2026 01:00:25 +0100 Subject: [PATCH] Add logging to debug active download identification and speed --- server/clients/SABnzbdClient.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/clients/SABnzbdClient.js b/server/clients/SABnzbdClient.js index f3f1d46..264d1bd 100644 --- a/server/clients/SABnzbdClient.js +++ b/server/clients/SABnzbdClient.js @@ -62,8 +62,12 @@ class SABnzbdClient extends DownloadClient { const activeSlot = queueData.queue.slots.find(slot => slot.status === 'Downloading'); const activeSpeed = activeSlot && clientStatus ? (clientStatus.kbpersec ? clientStatus.kbpersec * 1024 : 0) : 0; + logToFile(`[SABnzbd:${this.name}] Active slot: ${activeSlot ? activeSlot.nzo_id : 'none'}, Speed: ${activeSpeed}, Client status: ${clientStatus ? JSON.stringify({ kbpersec: clientStatus.kbpersec }) : 'none'}`); + for (const slot of queueData.queue.slots) { - downloads.push(this.normalizeDownload(slot, 'queue', activeSlot === slot ? activeSpeed : 0)); + const slotSpeed = activeSlot === slot ? activeSpeed : 0; + logToFile(`[SABnzbd:${this.name}] Slot ${slot.nzo_id} status ${slot.status}, speed ${slotSpeed}`); + downloads.push(this.normalizeDownload(slot, 'queue', slotSpeed)); } }