From fea49167c5188e3645044d9aae4aa676809011bd Mon Sep 17 00:00:00 2001 From: Jamie Date: Tue, 19 Aug 2014 23:47:16 +0100 Subject: [PATCH] Use correct item name --- sickbeard/notifiers/trakt.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sickbeard/notifiers/trakt.py b/sickbeard/notifiers/trakt.py index 652b7b27..29a264a0 100644 --- a/sickbeard/notifiers/trakt.py +++ b/sickbeard/notifiers/trakt.py @@ -67,7 +67,8 @@ class TraktNotifier: # URL parameters, should not need to recheck data (done above) data = { 'tvdb_id': ep_obj.show.indexerid, - 'title': ep_obj.show.name,'year': ep_obj.show.startyear + 'title': ep_obj.show.name, + 'year': ep_obj.show.startyear } TraktCall("show/unwatchlist/%API%", self._api(), self._username(), self._password(), data) @@ -77,17 +78,19 @@ class TraktNotifier: # Convert watchlist to only contain current show for show in watchlist: - if unicode(data['shows'][0]['tvdb_id']) == show['tvdb_id']: - data_show = { - 'title': show['title'], - 'tvdb_id': show['tvdb_id'], - 'episodes': [] - } + # Check if tvdb_id exists + if 'tvdb_id' in show: + if unicode(data['tvdb_id']) == show['tvdb_id']: + data_show = { + 'title': show['title'], + 'tvdb_id': show['tvdb_id'], + 'episodes': [] + } - # Add series and episode (number) to the arry - for episodes in show['episodes']: - ep = {'season': episodes['season'], 'episode': episodes['number']} - data_show['episodes'].append(ep) + # Add series and episode (number) to the arry + for episodes in show['episodes']: + ep = {'season': episodes['season'], 'episode': episodes['number']} + data_show['episodes'].append(ep) if data_show is not None: TraktCall("show/episode/unwatchlist/%API%", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD, data_show)