From 47289c903a2ce7098bf68b297df0812ddc34b167 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Fri, 27 Jun 2014 12:05:36 +0930 Subject: [PATCH] get download id from SABnzbd --- nzbtomedia/nzbToMediaUtil.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nzbtomedia/nzbToMediaUtil.py b/nzbtomedia/nzbToMediaUtil.py index f4a43ffc..d3a6874b 100644 --- a/nzbtomedia/nzbToMediaUtil.py +++ b/nzbtomedia/nzbToMediaUtil.py @@ -682,7 +682,7 @@ def find_download(clientAgent, download_id): if hash == download_id: return True if clientAgent == 'deluge': - pass + return False if clientAgent == 'sabnzbd': baseURL = "http://%s:%s/api" % (nzbtomedia.SABNZBDHOST, nzbtomedia.SABNZBDPORT) url = baseURL @@ -695,11 +695,12 @@ def find_download(clientAgent, download_id): r = requests.get(url, params=params, verify=False) except requests.ConnectionError: logger.error("Unable to open URL") - return 1 # failure + return False # failure result = r.json() if result['files']: return True + return False def cleanFileName(filename):