From 4c775ce432c1112ddcf76d2dd89f18a12370b966 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Tue, 21 Apr 2020 13:00:24 +1200 Subject: [PATCH] Keep cmd take 2 #1738 --- core/forks.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/forks.py b/core/forks.py index e2144abe..69783c74 100644 --- a/core/forks.py +++ b/core/forks.py @@ -39,6 +39,7 @@ def api_check(r, params, rem_params): try: optional_parameters = json_data['optionalParameters'].keys() + optional_parameters.add('cmd') # Don't remove cmd from api params # Find excess parameters excess_parameters = set(params).difference(optional_parameters) logger.debug('Removing excess parameters: {}'.format(sorted(excess_parameters))) @@ -139,8 +140,6 @@ def auto_fork(section, input_category): if apikey: rem_params, found = api_check(r, params, rem_params) if found: - if 'cmd' in rem_params: - rem_params.pop('cmd') # Don't remove this param. params['cmd'] = 'sg.postprocess' else: # try different api set for non-SickGear forks. url = '{protocol}{host}:{port}{root}/api/{apikey}/?cmd=help&subject=postprocess'.format( @@ -152,8 +151,6 @@ def auto_fork(section, input_category): logger.info('Could not connect to {section}:{category} to perform auto-fork detection!'.format (section=section, category=input_category)) rem_params, found = api_check(r, params, rem_params) - if 'cmd' in rem_params: - rem_params.pop('cmd') # Don't remove this param. params['cmd'] = 'postprocess' else: # Find excess parameters