mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 01:43:37 +00:00
Merge pull request #142 from adam111316/feature/FixTraktNoneType
Fix for #140 : 'NoneType' object is not iterable in trakt module
This commit is contained in:
commit
bac2e0d954
2 changed files with 23 additions and 17 deletions
|
@ -77,6 +77,8 @@
|
||||||
* Fix restart issue
|
* Fix restart issue
|
||||||
* Fix to use new TorrentDay URLs
|
* Fix to use new TorrentDay URLs
|
||||||
* Fix typo in menu item Manage/Update XBMC
|
* Fix typo in menu item Manage/Update XBMC
|
||||||
|
* Fix 'NoneType' object is not iterable in trakt module
|
||||||
|
* Add log message for when trakt does not return a watchlist
|
||||||
|
|
||||||
|
|
||||||
### 0.4.0 (2014-12-04 10:50:00 UTC)
|
### 0.4.0 (2014-12-04 10:50:00 UTC)
|
||||||
|
|
|
@ -83,6 +83,7 @@ class TraktNotifier:
|
||||||
# Start by getting all episodes in the watchlist
|
# 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)
|
watchlist = TraktCall("user/watchlist/episodes.json/%API%/" + sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
|
||||||
|
|
||||||
|
if watchlist is not None:
|
||||||
# Convert watchlist to only contain current show
|
# Convert watchlist to only contain current show
|
||||||
for show in watchlist:
|
for show in watchlist:
|
||||||
# Check if tvdb_id exists
|
# Check if tvdb_id exists
|
||||||
|
@ -100,6 +101,9 @@ class TraktNotifier:
|
||||||
data_show['episodes'].append(ep)
|
data_show['episodes'].append(ep)
|
||||||
if data_show is not None:
|
if data_show is not None:
|
||||||
TraktCall("show/episode/unwatchlist/%API%", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD, data_show)
|
TraktCall("show/episode/unwatchlist/%API%", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD, data_show)
|
||||||
|
else:
|
||||||
|
logger.log('Failed to get watchlist from trakt. Unable to remove episode from watchlist',
|
||||||
|
logger.ERROR)
|
||||||
|
|
||||||
def test_notify(self, api, username, password):
|
def test_notify(self, api, username, password):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue