From 0c4003a8b1ab6d495f08cbe64b90c17ff7a2a5c8 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Tue, 25 Nov 2014 15:42:41 +1030 Subject: [PATCH] add better logging for CDH checking. Fixes #583 --- nzbtomedia/autoProcess/autoProcessTV.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nzbtomedia/autoProcess/autoProcessTV.py b/nzbtomedia/autoProcess/autoProcessTV.py index 10b6f8a2..b9499fcc 100644 --- a/nzbtomedia/autoProcess/autoProcessTV.py +++ b/nzbtomedia/autoProcess/autoProcessTV.py @@ -291,8 +291,10 @@ class autoProcessTV: try: res = json.loads(r.content) scan_id = int(res['id']) + logger.debug("Scan started with id: %s" % (str(scan_id)), section) Started = True - except: + except Exception as e: + logger.warning("No scan id was returned due to: %s" % (e), section) scan_id = None Started = False @@ -312,6 +314,8 @@ class autoProcessTV: if command_status and command_status in ['completed', 'failed']: break n += 1 + if command_status: + logger.debug("The Scan command return status: %s" % (command_status), section) if not os.path.exists(dirName): logger.debug("The directory %s has been removed. Renaming was successful." % (dirName), section) return [0, "%s: Successfully post-processed %s" % (section, inputName) ] @@ -321,7 +325,7 @@ class autoProcessTV: elif command_status and command_status in ['failed']: logger.debug("The Scan command has failed. Renaming was not successful.", section) #return [1, "%s: Failed to post-process %s" % (section, inputName) ] - if self.CDH(url2, headers) and clientAgent in ['sabnzbd', 'nzbget']: + if self.CDH(url2, headers): logger.debug("The Scan command did not return status completed, but complete Download Handling is enabled. Passing back to %s." % (section), section) return [status, "%s: Complete DownLoad Handling is enabled. Passing back to %s" % (section, section) ] else: