|
|
@ -2532,6 +2532,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 = [] |
|
|
@ -2570,12 +2571,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 |
|
|
|
|
|
|
@ -2609,7 +2609,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") |
|
|
|
|
|
|
|