From 3eec21704a73971017041cca28d7f0e84051f236 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Thu, 20 Nov 2014 18:41:08 +0000 Subject: [PATCH] Fix a handler when ShowData is not available in tvdb and tvrage APIs. "KeyError:" Traceback is addressed. --- CHANGES.md | 1 + lib/tvdb_api/tvdb_api.py | 2 +- lib/tvrage_api/tvrage_api.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a6c8dcbc..6cd107d4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,6 +32,7 @@ * Change suppress HTTPS verification InsecureRequestWarning as many sites use self-certified certificates * Fix API endpoint Episode.SetStatus to "Wanted" * Change airdateModifyStamp to handle hour that is "00:00" +* Fix a handler when ShowData is not available in tvdb and tvrage APIs [develop changelog] diff --git a/lib/tvdb_api/tvdb_api.py b/lib/tvdb_api/tvdb_api.py index 00a3bf89..5dc4b794 100644 --- a/lib/tvdb_api/tvdb_api.py +++ b/lib/tvdb_api/tvdb_api.py @@ -936,7 +936,7 @@ class Tvdb: # Item is integer, treat as show id if key not in self.shows: self._getShowData(key, self.config['language'], True) - return self.shows[key] + return (None, self.shows[key])[key in self.show] key = str(key).lower() self.config['searchterm'] = key diff --git a/lib/tvrage_api/tvrage_api.py b/lib/tvrage_api/tvrage_api.py index ee1a07e5..1465f2ed 100644 --- a/lib/tvrage_api/tvrage_api.py +++ b/lib/tvrage_api/tvrage_api.py @@ -658,7 +658,7 @@ class TVRage: # Item is integer, treat as show id if key not in self.shows: self._getShowData(key, True) - return self.shows[key] + return (None, self.shows[key])[key in self.show] key = key.lower() self.config['searchterm'] = key