Created
January 25, 2020 16:36
-
-
Save henryjfry/5b999b1629d66e1b0b10315a4ff7f7cd to your computer and use it in GitHub Desktop.
TMDB Helper - Artwork ~/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/plugin.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_fanarttv_artwork(self, item, tmdbtype=None, tmdb_id=None, tvdb_id=None): | |
if not self.fanarttv or tmdbtype not in ['movie', 'tv']: | |
return item | |
artwork, lookup_id, func = None, None, None | |
if tmdbtype == 'tv': | |
lookup_id = tvdb_id or item.get('tvdb_id') | |
func = self.fanarttv.get_tvshow_allart_lc | |
elif tmdbtype == 'movie': | |
lookup_id = tmdb_id or item.get('tmdb_id') | |
func = self.fanarttv.get_movie_allart_lc | |
if not lookup_id or not func: | |
return item | |
artwork = func(lookup_id) | |
if artwork: | |
item['discart'] = item.get('discart') or artwork.get('discart') or '' | |
item['clearart'] = item.get('clearart') or artwork.get('clearart') or '' | |
item['clearlogo'] = item.get('clearlogo') or artwork.get('clearlogo') or '' | |
item['landscape'] = item.get('landscape') or artwork.get('landscape') or '' | |
item['banner'] = item.get('banner') or artwork.get('banner') or '' | |
item['fanart'] = item.get('fanart') or artwork.get('fanart') or '' | |
item['poster'] = item.get('poster') or artwork.get('poster') or '' | |
return item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment