only report success and clean if we get a success comment from SickBeard. fixes #348 #351

This commit is contained in:
clinton-hall 2014-04-29 12:02:50 +09:30
commit 8188455e13

View file

@ -147,11 +147,18 @@ class autoProcessTV:
logger.error("Unable to open URL: %s" % (url), section) logger.error("Unable to open URL: %s" % (url), section)
return 1 # failure return 1 # failure
Success = False
for line in r.iter_lines(): for line in r.iter_lines():
if line: logger.postprocess("%s" % (line), section) if line:
logger.postprocess("%s" % (line), section)
if "Processing succeeded for" in line: # We set Success based on the last non-empty line in the output.
Success = True
if status != 0 and delete_failed and not os.path.dirname(dirName) == dirName: if status != 0 and delete_failed and not os.path.dirname(dirName) == dirName:
logger.postprocess("Deleting failed files and folder %s" % (dirName),section) logger.postprocess("Deleting failed files and folder %s" % (dirName),section)
rmDir(dirName) rmDir(dirName)
return 0 # Success if Success:
return 0
else:
return 1