def _saveextrafanart(mediatype, arttype): if not arttype_matches_base(arttype, 'fanart') or not split_arttype(arttype)[1]: return False if not mediatypes.downloadartwork(mediatype, 'fanart1'): return False return settings.save_extrafanart and mediatype in (mediatypes.MOVIE, mediatypes.TVSHOW) \ or settings.save_extrafanart_mvids and mediatype == mediatypes.MUSICVIDEO
def get_downloadable_art(mediaitem, allartwork): if allartwork: downloadable = dict(mediaitem.art) downloadable.update(mediaitem.selectedart) else: downloadable = dict(mediaitem.selectedart) for arttype in list(downloadable): if not downloadable[arttype] or not downloadable[arttype].startswith('http') or \ not mediatypes.downloadartwork(mediaitem.mediatype, arttype): del downloadable[arttype] return downloadable
def has_art_todownload(artmap, mediatype): return next( (True for arttype, url in artmap.items() if url and url.startswith('http') and mediatypes.downloadartwork(mediatype, arttype)), False)