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( 'infoproperties', {}).get('tvshow.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['extrafanart'] = item.get( 'extrafanart') or utils.iterate_extraart( artwork.get('extrafanart', [])) or '' return item
def get_extra_artwork(self, tmdb=None, fanarttv=None): if not fanarttv: return artwork = None if self.infolabels.get('mediatype') == 'tvshow' and (self.tvdb_id or tmdb): self.tvdb_id = self.tvdb_id or tmdb.get_item_externalid( 'tv', self.tmdb_id, 'tvdb_id') artwork = fanarttv.get_tvshow_allart_lc(self.tvdb_id) elif self.infolabels.get('mediatype') == 'movie': artwork = fanarttv.get_movie_allart_lc(self.tmdb_id) if artwork: self.discart = self.discart or artwork.get('discart') self.clearart = self.clearart or artwork.get('clearart') self.clearlogo = self.clearlogo or artwork.get('clearlogo') self.landscape = self.landscape or artwork.get('landscape') self.banner = self.banner or artwork.get('banner') self.fanart = self.fanart or artwork.get('fanart') self.extrafanart = utils.iterate_extraart( artwork.get('extrafanart', []), self.extrafanart)