Tweak code for episode artwork
This commit is contained in:
parent
303adbf02e
commit
206c2a319b
2 changed files with 11 additions and 10 deletions
|
@ -760,13 +760,17 @@ class API(object):
|
||||||
|
|
||||||
# Grab artwork from Plex
|
# Grab artwork from Plex
|
||||||
artworks = {}
|
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():
|
for kodi_artwork, plex_artwork in v.KODI_TO_PLEX_ARTWORK.iteritems():
|
||||||
art = self._one_artwork(plex_artwork)
|
art = self._one_artwork(plex_artwork)
|
||||||
if art:
|
if art:
|
||||||
artworks[kodi_artwork] = art
|
artworks[kodi_artwork] = art
|
||||||
if self.plex_type() in (v.PLEX_TYPE_EPISODE,
|
if self.plex_type() in (v.PLEX_TYPE_SONG, v.PLEX_TYPE_ALBUM):
|
||||||
v.PLEX_TYPE_SONG,
|
|
||||||
v.PLEX_TYPE_ALBUM):
|
|
||||||
# Get parent item artwork if the main item is missing artwork
|
# Get parent item artwork if the main item is missing artwork
|
||||||
if 'fanart' not in artworks:
|
if 'fanart' not in artworks:
|
||||||
art = self._one_artwork('parentArt')
|
art = self._one_artwork('parentArt')
|
||||||
|
|
|
@ -991,13 +991,10 @@ class TVShows(Items):
|
||||||
self.kodi_db.modify_people(episodeid,
|
self.kodi_db.modify_people(episodeid,
|
||||||
v.KODI_TYPE_EPISODE,
|
v.KODI_TYPE_EPISODE,
|
||||||
api.people_list())
|
api.people_list())
|
||||||
# Wide "screenshot" of particular episode
|
artwork.modify_artwork(api.artwork(),
|
||||||
poster = item.attrib.get('thumb')
|
episodeid,
|
||||||
if poster:
|
v.KODI_TYPE_EPISODE,
|
||||||
poster = api.attach_plex_token_to_url(
|
kodicursor)
|
||||||
"%s%s" % (self.server, poster))
|
|
||||||
artwork.modify_art(
|
|
||||||
poster, episodeid, v.KODI_TYPE_EPISODE, "thumb", kodicursor)
|
|
||||||
streams = api.mediastreams()
|
streams = api.mediastreams()
|
||||||
self.kodi_db.modify_streams(fileid, streams, runtime)
|
self.kodi_db.modify_streams(fileid, streams, runtime)
|
||||||
self.kodi_db.addPlaystate(fileid,
|
self.kodi_db.addPlaystate(fileid,
|
||||||
|
|
Loading…
Add table
Reference in a new issue