Fix log message:

* Renamed url1 to url
* Added `section` argument to CDH
* Removed undefined variable `good_files`
This commit is contained in:
labrys 2016-05-31 04:09:14 -04:00 committed by Labrys
commit 88c9d74206
2 changed files with 5 additions and 5 deletions

View file

@ -80,7 +80,7 @@ class autoProcessMusic(object):
inputName, dirName = convert_to_ascii(inputName, dirName)
if listMediaFiles(dirName, media=False, audio=True, meta=False, archives=False) and status:
logger.info("Status shown as failed from Downloader, but %s valid video files found. Setting as successful." % (str(good_files)), section)
logger.info("Status shown as failed from Downloader, but valid video files found. Setting as successful.", section)
status = 0
if status == 0:

View file

@ -22,7 +22,7 @@ class autoProcessTV(object):
try:
r = requests.get(url, params=params, headers=headers, stream=True, verify=False, timeout=(30, 60))
except requests.ConnectionError:
logger.error("Unable to open URL: %s" % (url1), section)
logger.error("Unable to open URL: %s" % url, section)
return None
if r.status_code not in [requests.codes.ok, requests.codes.created, requests.codes.accepted]:
logger.error("Server returned status %s" % (str(r.status_code)), section)
@ -35,7 +35,7 @@ class autoProcessTV(object):
logger.error("%s did not return expected json data." % section, section)
return None
def CDH(self, url2, headers):
def CDH(self, url2, headers, section="MAIN"):
try:
r = requests.get(url2, params={}, headers=headers, stream=True, verify=False, timeout=(30, 60))
except requests.ConnectionError:
@ -305,8 +305,8 @@ class autoProcessTV(object):
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):
logger.debug("The Scan command did not return status completed, but complete Download Handling is enabled. Passing back to %s." % (section), section)
if self.CDH(url2, headers, section=section):
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:
logger.warning("The Scan command did not return a valid status. Renaming was not successful.", section)