Add logging to debug active download identification and speed
Some checks failed
Build and Push Docker Image / build (push) Successful in 29s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 58s
CI / Security audit (push) Successful in 1m11s
CI / Tests & coverage (push) Failing after 1m18s

This commit is contained in:
2026-05-20 01:00:25 +01:00
parent 8549746721
commit a562cfe9aa

View File

@@ -62,8 +62,12 @@ class SABnzbdClient extends DownloadClient {
const activeSlot = queueData.queue.slots.find(slot => slot.status === 'Downloading'); const activeSlot = queueData.queue.slots.find(slot => slot.status === 'Downloading');
const activeSpeed = activeSlot && clientStatus ? (clientStatus.kbpersec ? clientStatus.kbpersec * 1024 : 0) : 0; 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) { 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));
} }
} }