From 16b146284d7bcfc2eb923119c2464508ada01ef6 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 6 Nov 2014 23:22:10 +0800 Subject: [PATCH] Fix invalid responses when using sickbeard.searchtvdb api command --- CHANGES.md | 1 + sickbeard/webapi.py | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1ebcf94c..8f782d58 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -40,6 +40,7 @@ * Add handling for when deleting a show and the show folder no longer exists * Fix Coming Episodes/Layout Calender/View Paused and tweak its UI text * Made all init scripts executable +* Fix invalid responses when using sickbeard.searchtvdb api command [develop changelog] * Change improve display of progress bars in the Downloads columns of the show list page diff --git a/sickbeard/webapi.py b/sickbeard/webapi.py index 9255dfb2..2b4abd1e 100644 --- a/sickbeard/webapi.py +++ b/sickbeard/webapi.py @@ -1595,7 +1595,7 @@ class CMD_SickBeardSearchIndexers(ApiCall): self.name, args = self.check_params(args, kwargs, "name", None, False, "string", []) self.indexerid, args = self.check_params(args, kwargs, "indexerid", None, False, "int", []) self.lang, args = self.check_params(args, kwargs, "lang", "en", False, "string", self.valid_languages.keys()) - self.indexer, args = self.check_params(args, kwargs, "indexer", None, False, "string", []) + self.indexer, args = self.check_params(args, kwargs, "indexer", 1, False, "int", []) # super, missing, help ApiCall.__init__(self, handler, args, kwargs) @@ -1620,10 +1620,11 @@ class CMD_SickBeardSearchIndexers(ApiCall): results = [] for curSeries in apiData: - results.append({"indexerid": int(curSeries.findtext('seriesid')), - "tvdbid": int(curSeries.findtext('seriesid')), - "name": curSeries.findtext('SeriesName'), - "first_aired": curSeries.findtext('FirstAired')}) + results.append({"indexerid": int(curSeries['id']), + "tvdbid": int(curSeries['id']), + "name": curSeries['seriesname'], + "first_aired": curSeries['firstaired'], + "indexer": self.indexer}) lang_id = self.valid_languages[self.lang] return _responds(RESULT_SUCCESS, {"results": results, "langid": lang_id})