From 4103a7dc05a0da5409df5caa90fd314d3cf3aa41 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Tue, 10 Aug 2021 21:32:06 +1200 Subject: [PATCH] Fix auto-fork detection (#1839) * Fix Fork Detection when parameters not exact match. #1838 * Fix logging of detected fork. #1838 * Fix SickGear fork detection #1838 --- core/__init__.py | 2 +- core/auto_process/managers/sickbeard.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/__init__.py b/core/__init__.py index 7580c969..8407fbc5 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -118,7 +118,7 @@ FORKS = { FORK_MEDUSA_API: {'path': None, 'failed': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'delete_files': None, 'is_priority': None, 'cmd': 'postprocess'}, FORK_MEDUSA_APIV2: {'proc_dir': None, 'resource': None, 'failed': None, 'process_method': None, 'force': None, 'type': None, 'delete_on': None, 'is_priority': None}, FORK_SICKGEAR: {'dir': None, 'failed': None, 'process_method': None, 'force': None}, - FORK_SICKGEAR_API: {'path': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'is priority': None, 'failed': None, 'cmd': 'sg.postprocess'}, + FORK_SICKGEAR_API: {'path': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'is_priority': None, 'failed': None, 'cmd': 'sg.postprocess'}, FORK_STHENO: {'proc_dir': None, 'failed': None, 'process_method': None, 'force': None, 'delete_on': None, 'ignore_subs': 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/auto_process/managers/sickbeard.py b/core/auto_process/managers/sickbeard.py index add1e54f..7d19076c 100644 --- a/core/auto_process/managers/sickbeard.py +++ b/core/auto_process/managers/sickbeard.py @@ -166,12 +166,12 @@ class InitSickBeard(object): fork = ['default', params] elif fork == 'auto': - fork = self.detect_fork() + self.detect_fork() logger.info('{section}:{category} fork set to {fork}'.format - (section=self.section, category=self.input_category, fork=fork[0])) - core.FORK_SET = fork - self.fork, self.fork_params = fork[0], fork[1] + (section=self.section, category=self.input_category, fork=self.fork[0])) + core.FORK_SET = self.fork + self.fork, self.fork_params = self.fork[0], self.fork[1] # This will create the fork object, and attach to self.fork_obj. self._init_fork() return self.fork, self.fork_params @@ -297,8 +297,6 @@ class InitSickBeard(object): (section=self.section, category=self.input_category)) self.fork = list(core.FORKS.items())[list(core.FORKS.keys()).index(core.FORK_DEFAULT)] - return fork - def _init_fork(self): # These need to be imported here, to prevent a circular import. from .pymedusa import PyMedusa, PyMedusaApiV1, PyMedusaApiV2