Turn private into public method

This commit is contained in:
croneter 2018-07-19 14:54:46 +02:00
parent 232d3a3199
commit 1721aad580
2 changed files with 9 additions and 9 deletions

View file

@ -687,7 +687,7 @@ def playlists(plex_playlist_type):
if not api.playlist_type() == plex_playlist_type: if not api.playlist_type() == plex_playlist_type:
continue continue
listitem = ListItem(api.title()) listitem = ListItem(api.title())
listitem.setArt({'thumb': api._one_artwork('composite')}) listitem.setArt({'thumb': api.one_artwork('composite')})
url = "plugin://%s/" % v.ADDON_ID url = "plugin://%s/" % v.ADDON_ID
key = api.path_and_plex_id() key = api.path_and_plex_id()
params = { params = {

View file

@ -816,7 +816,7 @@ class API(object):
'subtitle': subtitlelanguages 'subtitle': subtitlelanguages
} }
def _one_artwork(self, art_kind): def one_artwork(self, art_kind):
artwork = self.item.get(art_kind) artwork = self.item.get(art_kind)
if artwork and not artwork.startswith('http'): if artwork and not artwork.startswith('http'):
if '/composite/' in artwork: if '/composite/' in artwork:
@ -869,13 +869,13 @@ class API(object):
# the other artwork will be saved under season and show # the other artwork will be saved under season and show
# EXCEPT if you're constructing a listitem # EXCEPT if you're constructing a listitem
if not full_artwork: if not full_artwork:
art = self._one_artwork('thumb') art = self.one_artwork('thumb')
if art: if art:
artworks['thumb'] = art artworks['thumb'] = art
return artworks return artworks
for kodi_artwork, plex_artwork in \ for kodi_artwork, plex_artwork in \
v.KODI_TO_PLEX_ARTWORK_EPISODE.iteritems(): v.KODI_TO_PLEX_ARTWORK_EPISODE.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 not full_artwork: if not full_artwork:
@ -917,24 +917,24 @@ class API(object):
# if self.plex_type() == v.PLEX_TYPE_EPISODE: # if self.plex_type() == v.PLEX_TYPE_EPISODE:
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_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 # 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')
if art: if art:
artworks['fanart1'] = art artworks['fanart1'] = art
if 'poster' not in artworks: if 'poster' not in artworks:
art = self._one_artwork('parentThumb') art = self.one_artwork('parentThumb')
if art: if art:
artworks['poster'] = art artworks['poster'] = art
if self.plex_type() in (v.PLEX_TYPE_SONG, if self.plex_type() in (v.PLEX_TYPE_SONG,
v.PLEX_TYPE_ALBUM, v.PLEX_TYPE_ALBUM,
v.PLEX_TYPE_ARTIST): v.PLEX_TYPE_ARTIST):
# need to set poster also as thumb # need to set poster also as thumb
art = self._one_artwork('thumb') art = self.one_artwork('thumb')
if art: if art:
artworks['thumb'] = art artworks['thumb'] = art
return artworks return artworks
@ -1473,7 +1473,7 @@ class API(object):
listitem = self._create_photo_listitem(listitem) listitem = self._create_photo_listitem(listitem)
# Only set the bare minimum of artwork # Only set the bare minimum of artwork
listitem.setArt({'icon': 'DefaultPicture.png', listitem.setArt({'icon': 'DefaultPicture.png',
'fanart': self._one_artwork('thumb')}) 'fanart': self.one_artwork('thumb')})
else: else:
listitem = self._create_video_listitem(listitem, listitem = self._create_video_listitem(listitem,
append_show_title, append_show_title,