From e50704df732426810e175d5fdb72c262a1faeb2b Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Sun, 3 Nov 2013 22:02:52 +1030 Subject: [PATCH] added TPB-failed branch. fixes #198 --- TorrentToMedia.py | 2 +- autoProcess/autoProcessTV.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 50a8f174..f69380fe 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -36,7 +36,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID): extractionSuccess = False Logger.debug("MAIN: Received Directory: %s | Name: %s | Category: %s", inputDirectory, inputName, inputCategory) - if sbFork == "TPB" and inputCategory == sbCategory: + if sbFork in ["TPB", "TPB-failed"] and inputCategory == sbCategory: Logger.info("MAIN: Calling Sick-Beard to post-process: %s", inputName) result = autoProcessTV.processEpisode(inputDirectory, inputName, int(0)) if result == 1: diff --git a/autoProcess/autoProcessTV.py b/autoProcess/autoProcessTV.py index 7e470f93..d868ef28 100644 --- a/autoProcess/autoProcessTV.py +++ b/autoProcess/autoProcessTV.py @@ -115,10 +115,10 @@ def processEpisode(dirName, nzbName=None, failed=False): mediaContainer = (config.get("Extensions", "mediaExtensions")).split(',') minSampleSize = int(config.get("Extensions", "minSampleSize")) - if fork != "TPB": + if not fork in ["TPB", "TPB-failed"]: process_all_exceptions(nzbName.lower(), dirName) - if nzbName != "Manual Run" and fork != "TPB": + if nzbName != "Manual Run" and not fork in ["TPB", "TPB-failed"]: # Now check if movie files exist in destination: video = int(0) for dirpath, dirnames, filenames in os.walk(dirName): @@ -157,12 +157,17 @@ def processEpisode(dirName, nzbName=None, failed=False): Logger.info("The download failed. Sending 'failed' process request to SickBeard's failed branch") # if you have specified you are using development branch from fork https://github.com/Tolstyak/Sick-Beard.git - if fork == "TPB": + if fork in ["TPB", "TPB-failed"]: params['dir'] = dirName if nzbName != None: params['nzbName'] = nzbName if status == 0: Logger.info("The download succeeded. Sending process request to SickBeard's TPB branch") + if fork == "TPB-failed": + params['failed'] = failed + elif fork == "TPB-failed": + Logger.info("The download failed. Sending 'failed' process request to SickBeard's TPB-failed branch") + params['failed'] = failed else: Logger.info("The download failed. Nothing to process") if delete_failed and os.path.isdir(dirName) and not dirName in ['sys.argv[0]','/','']: