diff --git a/autoProcess/autoSickBeardFork.py b/autoProcess/autoSickBeardFork.py index e87625a0..8859814f 100644 --- a/autoProcess/autoSickBeardFork.py +++ b/autoProcess/autoSickBeardFork.py @@ -63,14 +63,14 @@ def autoFork(fork=None): Logger.info("Attempting to auto-detect SickBeard fork") for f in forks.iteritems(): - url = protocol + host + ":" + port + web_root + "/home/postprocess/processEpisode?" + urllib.urlencode(f[1]) + url = protocol + host + ":" + port + web_root + "/home/postprocess/processEpisode?" + urllib.urlencode(f[1]['params']) # attempting to auto-detect fork urlObj = myOpener.openit(url) if urlObj.getcode() == 200: - Logger.info("SickBeard fork auto-detection successful. Fork set to %s", f[0]) - return f[0], f[1] + Logger.info("SickBeard fork auto-detection successful. Fork set to %s", f[1]['name']) + return f[1]['name'], f[1]['params'] # failed to auto-detect fork Logger.info("SickBeard fork auto-detection failed") @@ -78,9 +78,9 @@ def autoFork(fork=None): else: #if not fork in "auto" try: fork = fork if fork in SICKBEARD_FAILED or fork in SICKBEARD_TORRENT else fork_default - fork = [f for f in forks.iteritems() if f[0] == fork][0] + fork = [f for f in forks.iteritems() if f[1]['name'] == fork][0] except: - fork = [f for f in forks.iteritems() if f[0] == fork_default][0] + fork = [f for f in forks.iteritems() if f[1]['name'] == fork_default][0] - Logger.info("SickBeard fork set to %s", fork[0]) - return fork[0], fork[1] \ No newline at end of file + Logger.info("SickBeard fork set to %s", fork[1]['name']) + return fork[1]['name'], fork[1]['params'] \ No newline at end of file diff --git a/autoProcess/nzbToMediaEnv.py b/autoProcess/nzbToMediaEnv.py index 014a29c4..fcfa240d 100644 --- a/autoProcess/nzbToMediaEnv.py +++ b/autoProcess/nzbToMediaEnv.py @@ -15,12 +15,12 @@ fork_failed = "failed" fork_failed_new = "failed-new" fork_failed_torrent = "failed-torrent" -forks = {} -forks[fork_failed_torrent] = {"dir": None, "failed": None, "process_method": None} -forks[fork_failed] = {"dirName": None, "failed": None} -forks[fork_failed_new] = {"dir": None, "failed": None} -forks[fork_default_new] = {"dir": None, "process": None} -forks[fork_default] = {"dir": None} +forks = {} # these need to be in order of most unique params first. +forks[1] = {'name': fork_failed_torrent, 'params': {"dir": None, "failed": None, "process_method": None}} +forks[2] = {'name': fork_failed, 'params': {"dirName": None, "failed": None}} +forks[3] = {'name': fork_failed_new, 'params': {"dir": None, "failed": None}} +forks[4] = {'name': fork_default_new, 'params': {"dir": None, "process": None}} +forks[5] = {'name': fork_default, 'params': {"dir": None}} SICKBEARD_FAILED = [fork_failed, fork_failed_torrent, fork_failed_new] SICKBEARD_TORRENT = [fork_failed_torrent]