parent
00613e7ef5
commit
3bba2199e8
2 changed files with 27 additions and 19 deletions
|
@ -772,34 +772,35 @@ class API(object):
|
||||||
# Artwork lookup for episodes is broken for addon paths
|
# Artwork lookup for episodes is broken for addon paths
|
||||||
# Episodes is a bit special, only get the thumb, because all
|
# Episodes is a bit special, only get the thumb, because all
|
||||||
# the other artwork will be saved under season and show
|
# the other artwork will be saved under season and show
|
||||||
for kodi_artwork, plex_artwork in v.KODI_TO_PLEX_ARTWORK.iteritems():
|
for kodi_artwork, plex_artwork in \
|
||||||
|
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 full_artwork:
|
if not full_artwork:
|
||||||
with plexdb.Get_Plex_DB() as plex_db:
|
return artworks
|
||||||
db_item = plex_db.getItem_byId(self.plex_id())
|
with plexdb.Get_Plex_DB() as plex_db:
|
||||||
try:
|
try:
|
||||||
season_id = db_item[3]
|
season_id = plex_db.getItem_byId(self.plex_id())[3]
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return artworks
|
return artworks
|
||||||
# Grab artwork from the season
|
# Grab artwork from the season
|
||||||
with kodidb.GetKodiDB('video') as kodi_db:
|
with kodidb.GetKodiDB('video') as kodi_db:
|
||||||
season_art = kodi_db.get_art(season_id, v.KODI_TYPE_SEASON)
|
season_art = kodi_db.get_art(season_id, v.KODI_TYPE_SEASON)
|
||||||
for kodi_art in season_art:
|
for kodi_art in season_art:
|
||||||
artworks['season.%s' % kodi_art] = season_art[kodi_art]
|
artworks['season.%s' % kodi_art] = season_art[kodi_art]
|
||||||
# Get the show id
|
# Get the show id
|
||||||
with plexdb.Get_Plex_DB() as plex_db:
|
with plexdb.Get_Plex_DB() as plex_db:
|
||||||
db_item = plex_db.getItem_byId(self.grandparent_id())
|
|
||||||
try:
|
try:
|
||||||
show_id = db_item[0]
|
show_id = plex_db.getItem_byKodiId(season_id,
|
||||||
|
v.KODI_TYPE_SEASON)[1]
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return artworks
|
return artworks
|
||||||
# Grab more artwork from the show
|
# Grab more artwork from the show
|
||||||
with kodidb.GetKodiDB('video') as kodi_db:
|
with kodidb.GetKodiDB('video') as kodi_db:
|
||||||
show_art = kodi_db.get_art(show_id, v.KODI_TYPE_SHOW)
|
show_art = kodi_db.get_art(show_id, v.KODI_TYPE_SHOW)
|
||||||
for kodi_art in show_art:
|
for kodi_art in show_art:
|
||||||
artworks['tvshow.%s' % kodi_art] = show_art[kodi_art]
|
artworks['tvshow.%s' % kodi_art] = show_art[kodi_art]
|
||||||
return artworks
|
return artworks
|
||||||
|
|
||||||
if kodi_id:
|
if kodi_id:
|
||||||
|
|
|
@ -325,6 +325,13 @@ KODI_TO_PLEX_ARTWORK = {
|
||||||
'fanart': 'art'
|
'fanart': 'art'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KODI_TO_PLEX_ARTWORK_EPISODE = {
|
||||||
|
'thumb': 'thumb',
|
||||||
|
'poster': 'grandparentThumb',
|
||||||
|
'banner': 'banner',
|
||||||
|
'fanart': 'art'
|
||||||
|
}
|
||||||
|
|
||||||
# Might be implemented in the future: 'icon', 'landscape' (16:9)
|
# Might be implemented in the future: 'icon', 'landscape' (16:9)
|
||||||
ALL_KODI_ARTWORK = (
|
ALL_KODI_ARTWORK = (
|
||||||
'thumb',
|
'thumb',
|
||||||
|
|
Loading…
Reference in a new issue