From 9097f063923f05ffba16674ed9ca8028bda25959 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Fri, 11 Mar 2016 14:47:41 +0100 Subject: [PATCH] Fix librarysync key error --- resources/lib/PlexAPI.py | 8 ++++---- resources/lib/itemtypes.py | 13 +++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 04ec4341..b65e9e4d 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -1821,10 +1821,10 @@ class API(): ] """ item = self.item.attrib - key = item['grandparentRatingKey'] - title = item['grandparentTitle'] - season = item['parentIndex'] - episode = item['index'] + key = item.get('grandparentRatingKey') + title = item.get('grandparentTitle') + season = item.get('parentIndex') + episode = item.get('index') return key, title, season, episode def addPlexHeadersToUrl(self, url, arguments={}): diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 2ca321ef..e674b28e 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -1258,12 +1258,13 @@ class TVShows(Items): seriesId, seriesName, season, episode = API.getEpisodeDetails() if season is None: - if item.get('AbsoluteEpisodeNumber'): - # Anime scenario - season = 1 - episode = item['AbsoluteEpisodeNumber'] - else: - season = -1 + season = -1 + # if item.get('AbsoluteEpisodeNumber'): + # # Anime scenario + # season = 1 + # episode = item['AbsoluteEpisodeNumber'] + # else: + # season = -1 # Specials ordering within season if item.get('AirsAfterSeasonNumber'):