From 206c2a319bfc692e2ab6c0c36502175843cdb850 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 18 Mar 2018 19:18:44 +0100 Subject: [PATCH] Tweak code for episode artwork --- resources/lib/PlexAPI.py | 10 +++++++--- resources/lib/itemtypes.py | 11 ++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 843d85ec..bde44444 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -760,13 +760,17 @@ class API(object): # Grab artwork from Plex artworks = {} + if self.plex_type() == v.PLEX_TYPE_EPISODE: + # Episodes is a bit special, only get the thumb + art = self._one_artwork('thumb') + if art: + artworks['thumb'] = art + return artworks for kodi_artwork, plex_artwork in v.KODI_TO_PLEX_ARTWORK.iteritems(): art = self._one_artwork(plex_artwork) if art: artworks[kodi_artwork] = art - if self.plex_type() in (v.PLEX_TYPE_EPISODE, - v.PLEX_TYPE_SONG, - v.PLEX_TYPE_ALBUM): + if self.plex_type() in (v.PLEX_TYPE_SONG, v.PLEX_TYPE_ALBUM): # Get parent item artwork if the main item is missing artwork if 'fanart' not in artworks: art = self._one_artwork('parentArt') diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 97814cd6..56854776 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -991,13 +991,10 @@ class TVShows(Items): self.kodi_db.modify_people(episodeid, v.KODI_TYPE_EPISODE, api.people_list()) - # Wide "screenshot" of particular episode - poster = item.attrib.get('thumb') - if poster: - poster = api.attach_plex_token_to_url( - "%s%s" % (self.server, poster)) - artwork.modify_art( - poster, episodeid, v.KODI_TYPE_EPISODE, "thumb", kodicursor) + artwork.modify_artwork(api.artwork(), + episodeid, + v.KODI_TYPE_EPISODE, + kodicursor) streams = api.mediastreams() self.kodi_db.modify_streams(fileid, streams, runtime) self.kodi_db.addPlaystate(fileid,