From 5eabe43e48e610fc5fb22c775c2d9b17a5e39805 Mon Sep 17 00:00:00 2001 From: echel0n Date: Thu, 5 Jun 2014 12:17:49 -0700 Subject: [PATCH] Adding shows via TVRage fixed! --- lib/tvrage_api/tvrage_api.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/tvrage_api/tvrage_api.py b/lib/tvrage_api/tvrage_api.py index 87f5f187..c30f4173 100644 --- a/lib/tvrage_api/tvrage_api.py +++ b/lib/tvrage_api/tvrage_api.py @@ -443,7 +443,6 @@ class TVRage: if not isinstance(value, list): value = [value] value = '|' + '|'.join(value) + '|' - try: if key == 'firstaired' and value in "0000-00-00": new_value = str(dt.date.fromordinal(1)) @@ -513,7 +512,9 @@ class TVRage: """ if sid not in self.shows: self.shows[sid] = Show() - self.shows[sid].data[key] = value + + if not isinstance(key, dict or list) and not isinstance(value, dict or list): + self.shows[sid].data[key] = value def _cleanData(self, data): """Cleans up strings returned by tvrage.com @@ -522,8 +523,10 @@ class TVRage: - Replaces & with & - Trailing whitespace """ - data = data.replace(u"&", u"&") - data = data.strip() + + if not isinstance(data, dict or list): + data = data.replace(u"&", u"&") + data = data.strip() return data def search(self, series): @@ -594,7 +597,7 @@ class TVRage: self.config['params_epInfo']['sid'] = sid epsEt = self._getetsrc(self.config['url_epInfo'], self.config['params_epInfo']) - for season in epsEt['Episodelist']['Season']: + for season in epsEt['episodelist']['season']: episodes = season['episode'] if not isinstance(episodes, list): episodes = [episodes]