more userscript fixes. #425

This commit is contained in:
clinton-hall 2014-06-15 19:21:39 +09:30
commit c5103042ae

View file

@ -203,7 +203,7 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
logger.info("Calling %s:%s to post-process:%s" % (sectionName, usercat, inputName)) logger.info("Calling %s:%s to post-process:%s" % (sectionName, usercat, inputName))
result = 0 result = 0
if sectionName in ["UserScript"]: if sectionName == 'UserScript':
result = external_script(outputDestination, inputName, inputCategory) result = external_script(outputDestination, inputName, inputCategory)
if sectionName == 'CouchPotato': if sectionName == 'CouchPotato':
@ -233,6 +233,7 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
# remove torrent # remove torrent
nzbtomedia.remove_torrent(clientAgent, inputHash, inputID, inputName) nzbtomedia.remove_torrent(clientAgent, inputHash, inputID, inputName)
if not sectionName == 'UserScript': # for user script, we assume this is cleaned by the script or option USER_SCRIPT_CLEAN
# cleanup our processing folders of any misc unwanted files and empty directories # cleanup our processing folders of any misc unwanted files and empty directories
nzbtomedia.cleanDir(outputDestination, sectionName, inputCategory) nzbtomedia.cleanDir(outputDestination, sectionName, inputCategory)
@ -240,7 +241,7 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
def external_script(outputDestination, torrentName, torrentLabel): def external_script(outputDestination, torrentName, torrentLabel):
if nzbtomedia.USER_SCRIPT is None: # do nothing and return success. if nzbtomedia.USER_SCRIPT is None or nzbtomedia.USER_SCRIPT == "None": # do nothing and return success.
return 0 return 0
final_result = 0 # start at 0. final_result = 0 # start at 0.
num_files = 0 num_files = 0