Fix a handler when ShowData is not available in tvdb and tvrage APIs.

"KeyError:<show_id>" Traceback is addressed.
This commit is contained in:
JackDandy 2014-11-20 18:41:08 +00:00
parent 037f2e96b2
commit 3eec21704a
3 changed files with 3 additions and 2 deletions

View file

@ -32,6 +32,7 @@
* Change suppress HTTPS verification InsecureRequestWarning as many sites use self-certified certificates * Change suppress HTTPS verification InsecureRequestWarning as many sites use self-certified certificates
* Fix API endpoint Episode.SetStatus to "Wanted" * Fix API endpoint Episode.SetStatus to "Wanted"
* Change airdateModifyStamp to handle hour that is "00:00" * Change airdateModifyStamp to handle hour that is "00:00"
* Fix a handler when ShowData is not available in tvdb and tvrage APIs
[develop changelog] [develop changelog]

View file

@ -936,7 +936,7 @@ class Tvdb:
# Item is integer, treat as show id # Item is integer, treat as show id
if key not in self.shows: if key not in self.shows:
self._getShowData(key, self.config['language'], True) self._getShowData(key, self.config['language'], True)
return self.shows[key] return (None, self.shows[key])[key in self.show]
key = str(key).lower() key = str(key).lower()
self.config['searchterm'] = key self.config['searchterm'] = key

View file

@ -658,7 +658,7 @@ class TVRage:
# Item is integer, treat as show id # Item is integer, treat as show id
if key not in self.shows: if key not in self.shows:
self._getShowData(key, True) self._getShowData(key, True)
return self.shows[key] return (None, self.shows[key])[key in self.show]
key = key.lower() key = key.lower()
self.config['searchterm'] = key self.config['searchterm'] = key