diff --git a/core/__init__.py b/core/__init__.py index e3f75899..7f75ba8f 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -62,17 +62,17 @@ FORKS = {} FORK_DEFAULT = "default" FORK_FAILED = "failed" FORK_FAILED_TORRENT = "failed-torrent" -FORK_SICKRAGETV = "SickRageTV" FORK_SICKRAGE = "SickRage" -FORK_SICKRAGE_API = "SiCKRAGE-api" +FORK_SICKCHILL = "SickChill" +FORK_SICKBEARD_API = "SickBeard-api" FORK_MEDUSA = "Medusa" FORK_SICKGEAR = "SickGear" FORKS[FORK_DEFAULT] = {"dir": None} FORKS[FORK_FAILED] = {"dirName": None, "failed": None} FORKS[FORK_FAILED_TORRENT] = {"dir": None, "failed": None, "process_method": None} -FORKS[FORK_SICKRAGETV] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None} -FORKS[FORK_SICKRAGE] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "force_next": None} -FORKS[FORK_SICKRAGE_API] = {"path": None, "failed": None, "process_method": None, "force_replace": None, "return_data": None, "type": None, "delete": None, "force_next": None} +FORKS[FORK_SICKRAGE] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None} +FORKS[FORK_SICKCHILL] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "force_next": None} +FORKS[FORK_SICKBEARD_API] = {"path": None, "failed": None, "process_method": None, "force_replace": None, "return_data": None, "type": None, "delete": None, "force_next": None} FORKS[FORK_MEDUSA] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "ignore_subs":None} FORKS[FORK_SICKGEAR] = {"dir": None, "failed": None, "process_method": None, "force": None} ALL_FORKS = {k:None for k in set(list(itertools.chain.from_iterable([FORKS[x].keys() for x in FORKS.keys()])))} diff --git a/core/nzbToMediaAutoFork.py b/core/nzbToMediaAutoFork.py index e0a988db..a4bb9207 100644 --- a/core/nzbToMediaAutoFork.py +++ b/core/nzbToMediaAutoFork.py @@ -21,7 +21,7 @@ def autoFork(section, inputCategory): apikey = cfg.get("apikey") ssl = int(cfg.get("ssl", 0)) web_root = cfg.get("web_root", "") - replace = {'sickrage':'SickRage', 'sickragetv':'SickRageTV', 'sickgear':'SickGear', 'medusa':'Medusa', 'sickrage-api':'SiCKRAGE-api'} + replace = {'sickrage':'SickRage', 'sickchill':'SickChill', 'sickgear':'SickGear', 'medusa':'Medusa', 'sickbeard-api':'SickBeard-api'} f1 = replace[cfg.get("fork", "auto")] if cfg.get("fork", "auto") in replace else cfg.get("fork", "auto") try: fork = core.FORKS.items()[core.FORKS.keys().index(f1)] @@ -79,11 +79,17 @@ def autoFork(section, inputCategory): (section=section, category=inputCategory)) r = [] if r and r.ok: - for param in params: - if apikey: - if param not in r.json()['data']['optionalParameters'].keys(): + if apikey: + optionalParameters = [] + try: + optionalParameters = r.json()['data']['optionalParameters'].keys() + except: + optionalParameters = r.json()['data']['data']['optionalParameters'].keys() + for param in params: + if param not in optionalParameters: rem_params.append(param) - else: + else: + for param in params: if 'name="{param}"'.format(param=param) not in r.text: rem_params.append(param) for param in rem_params: