From 0b9f317d9d9e916fccdd15e9e86da9cc673aff2f Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Tue, 4 Aug 2020 10:29:54 +0200 Subject: [PATCH] Fix SickBeard search API compatibility issue. --- CHANGES.md | 7 ++++++- sickbeard/webapi.py | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8236193..8ab69aa 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ -### 0.21.41 (2020-07-31 09:25:00 UTC) +### 0.21.42 (2020-08-04 15:45:00 UTC) + +* Fix SickBeard search API compatibility issue + + +### 0.21.41 (2020-07-31 09:25:00 UTC) * Update NZBGet extension 2.5 to 2.6 diff --git a/sickbeard/webapi.py b/sickbeard/webapi.py index d9ac37e..07438b2 100644 --- a/sickbeard/webapi.py +++ b/sickbeard/webapi.py @@ -2516,6 +2516,7 @@ class CMD_SickGearSearchIndexers(ApiCall): raise ApiError('Mix of -1 (all Indexer) and specific Indexer not allowed') all_indexer = 1 == len(self.indexers) and -1 == self.indexers[0] + lang_id = self.valid_languages['en'] if self.name and not self.prodid: # only name was given results = [] @@ -2554,12 +2555,11 @@ class CMD_SickGearSearchIndexers(ApiCall): results = sorted(results, key=lambda x: x['relevance'], reverse=True) - return _responds(RESULT_SUCCESS, {"results": results, "langid": 'en'}) + return _responds(RESULT_SUCCESS, {"results": results, "langid": lang_id, "lang": 'en'}) elif self.prodid and not all_indexer and 1 == len(self.indexers): tvinfo_config = sickbeard.TVInfoAPI(self.indexers[0]).api_params.copy() - lang_id = 'en' tvinfo_config['language'] = 'en' tvinfo_config['custom_ui'] = classes.AllShowInfosNoFilterListUI @@ -2572,7 +2572,7 @@ class CMD_SickGearSearchIndexers(ApiCall): except Exception as e: if check_exception_type(e, ExceptionTuples.tvinfo_shownotfound, ExceptionTuples.tvinfo_error): self.log(u"Unable to find show with id " + str(self.prodid), logger.WARNING) - return _responds(RESULT_SUCCESS, {"results": [], "langid": lang_id}) + return _responds(RESULT_SUCCESS, {"results": [], "langid": lang_id, "lang": 'en'}) else: raise e @@ -2596,7 +2596,7 @@ class CMD_SickGearSearchIndexers(ApiCall): showOut[0]["tvdbid"] = None showOut = sorted(showOut, key=lambda x: x['relevance'], reverse=True) - return _responds(RESULT_SUCCESS, {"results": showOut, "langid": lang_id}) + return _responds(RESULT_SUCCESS, {"results": showOut, "langid": lang_id, "lang": 'en'}) else: return _responds(RESULT_FAILURE, msg="Either indexer + indexerid or name is required")