mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 08:53:37 +00:00
Fix for: 'NoneType' object is not iterable in trakt module
This commit is contained in:
parent
9d4122247e
commit
3b4346b053
1 changed files with 18 additions and 17 deletions
|
@ -83,23 +83,24 @@ class TraktNotifier:
|
|||
# Start by getting all episodes in the watchlist
|
||||
watchlist = TraktCall("user/watchlist/episodes.json/%API%/" + sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
|
||||
|
||||
# Convert watchlist to only contain current show
|
||||
for show in watchlist:
|
||||
# Check if tvdb_id exists
|
||||
if 'tvdb_id' in show:
|
||||
if unicode(data['shows'][0]['tvdb_id']) == show['tvdb_id']:
|
||||
data_show = {
|
||||
'title': show['title'],
|
||||
'tvdb_id': show['tvdb_id'],
|
||||
'episodes': []
|
||||
}
|
||||
if watchlist is not None:
|
||||
# Convert watchlist to only contain current show
|
||||
for show in watchlist:
|
||||
# Check if tvdb_id exists
|
||||
if 'tvdb_id' in show:
|
||||
if unicode(data['shows'][0]['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)
|
||||
if data_show is not None:
|
||||
TraktCall("show/episode/unwatchlist/%API%", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD, data_show)
|
||||
# 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)
|
||||
|
||||
def test_notify(self, api, username, password):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue