From 41b5ec1b8e8b821c3cd1457410206b0178fcd699 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 4 Nov 2018 16:55:24 +0100 Subject: [PATCH] Fix KeyError --- resources/lib/itemtypes/tvshows.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/lib/itemtypes/tvshows.py b/resources/lib/itemtypes/tvshows.py index 2cd49f4a..a7603527 100644 --- a/resources/lib/itemtypes/tvshows.py +++ b/resources/lib/itemtypes/tvshows.py @@ -289,12 +289,11 @@ class Season(ItemBase, TvShowMixin): return show_id = api.parent_plex_id() show = self.plexdb.show(show_id) - try: - parent_id = show[3] - except TypeError: + if not show: LOG.error('Could not find parent tv show for season %s. ' 'Skipping season for now.', plex_id) return + parent_id = show['parent_id'] kodi_id = self.kodi_db.add_season(parent_id, api.season_number()) self.artwork.modify_artwork(api.artwork(), kodi_id,