def process_failed(dirName, nzbName, result): """Process a download that did not complete correctly""" if sickrage.srCore.srConfig.USE_FAILED_DOWNLOADS: processor = None try: processor = failed_processor.FailedProcessor(dirName, nzbName) result.result = processor.process() process_fail_message = "" except FailedPostProcessingFailedException as e: result.result = False process_fail_message = e if processor: result.output += processor.log if sickrage.srCore.srConfig.DELETE_FAILED and result.result: if delete_folder(dirName, check_empty=False): result.output += logHelper("Deleted folder: " + dirName, sickrage.srCore.srLogger.DEBUG) if result.result: result.output += logHelper("Failed Download Processing succeeded: (" + str(nzbName) + ", " + dirName + ")") else: result.output += logHelper("Failed Download Processing failed: ({}, {}): {}" .format(nzbName, dirName, process_fail_message), sickrage.srCore.srLogger.WARNING)
def process_failed(self, dirName, nzbName): """Process a download that did not complete correctly""" try: processor = failed_processor.FailedProcessor(dirName, nzbName) self.result = processor.process() process_fail_message = "" except FailedPostProcessingFailedException as e: processor = None self.result = False process_fail_message = e if processor: self._output.append(processor.log) if sickrage.app.config.delete_failed and self.result: if self.delete_folder(dirName, check_empty=False): self.log("Deleted folder: " + dirName, sickrage.app.log.DEBUG) if self.result: self.log( "Failed Download Processing succeeded: (" + str(nzbName) + ", " + dirName + ")") else: self.log("Failed Download Processing failed: ({}, {}): {}" .format(nzbName, dirName, process_fail_message), sickrage.app.log.WARNING)