From 6d79f316a6be6105680398e253409bd8f7033e68 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Tue, 25 Nov 2014 11:02:47 +1030 Subject: [PATCH] NZBGet 13 includes more status information nzb['Status'] returns total (SUCESS/ALL) status and also failed status in V13+ This is particularly important when using fake detector scripts or stopping download due to health checks etc. http://nzbget.net/RPC_API_reference#Method_.22history.22 https://couchpota.to/forum/viewtopic.php?f=5&t=4644 --- couchpotato/core/downloaders/nzbget.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/downloaders/nzbget.py b/couchpotato/core/downloaders/nzbget.py index b46de778..54725bd5 100644 --- a/couchpotato/core/downloaders/nzbget.py +++ b/couchpotato/core/downloaders/nzbget.py @@ -163,12 +163,12 @@ class NZBGet(DownloaderBase): nzb_id = nzb['NZBID'] if nzb_id in ids: - log.debug('Found %s in NZBGet history. ParStatus: %s, ScriptStatus: %s, Log: %s', (nzb['NZBFilename'] , nzb['ParStatus'], nzb['ScriptStatus'] , nzb['Log'])) + log.debug('Found %s in NZBGet history. TotalStatus: %s, ParStatus: %s, ScriptStatus: %s, Log: %s', (nzb['NZBFilename'] , nzb['Status'], nzb['ParStatus'], nzb['ScriptStatus'] , nzb['Log'])) release_downloads.append({ 'id': nzb_id, 'name': nzb['NZBFilename'], - 'status': 'completed' if nzb['ParStatus'] in ['SUCCESS', 'NONE'] and nzb['ScriptStatus'] in ['SUCCESS', 'NONE'] else 'failed', - 'original_status': nzb['ParStatus'] + ', ' + nzb['ScriptStatus'], + 'status': 'completed' if 'SUCCESS' in nzb['Status'] else 'failed', + 'original_status': nzb['Status'], 'timeleft': str(timedelta(seconds = 0)), 'folder': sp(nzb['DestDir']) })