def getEpisodeArt(episode): """ return the best background art URL for the passed episode. """ seriesId = None for sk in Dict['series'].keys(): if Dict['series'][str(sk)]['title'] == episode['seriesTitle']: seriesId = int(sk) if seriesId is not None: artUrl = "" if Dict['series'][str(seriesId)]['tvdbId'] is not None: artUrl = fanartScrapper.getSeasonThumb( Dict['series'][str(seriesId)]['tvdbId'], episode['season'], rand=False) #Log.Debug("arturl: %s"%artUrl) if artUrl is not None: art = Function(getArt, url=artUrl) if artUrl == "" or artUrl is None: artUrl = Dict['series'][str(seriesId)]['art'] if artUrl == "" or artUrl is None: artUrl = R(CRUNCHYROLL_ART) else: artUrl = R(CRUNCHYROLL_ART) Log.Debug("artUrl: %s" % artUrl) return artUrl
def makeSeasonItem(season): art = R(CRUNCHYROLL_ART) if Dict['series'][str(season['seriesId'])]['tvdbId'] is not None: artUrl = fanartScrapper.getSeasonThumb(Dict['series'][str(season['seriesId'])]['tvdbId'], season['seasonnum']) Log.Debug("arturl: %s"%artUrl) if artUrl is not None: art = Function(getArt,url=artUrl) seasonItem = Function( DirectoryItem( SeasonMenu, season['title'], summary=season['description'].encode("utf-8"), #thumb=Function(getThumb,url=season['thumb']), art=art ), seriesId=season['seriesId'], season=season['seasonnum'] ) return seasonItem
def getEpisodeArt(episode): seriesId = None for sk in Dict['series'].keys(): if Dict['series'][str(sk)]['title']==episode['seriesTitle']: seriesId = int(sk) if seriesId is not None: artUrl = "" if Dict['series'][str(seriesId)]['tvdbId'] is not None: artUrl = fanartScrapper.getSeasonThumb(Dict['series'][str(seriesId)]['tvdbId'], episode['season'], rand=False) #Log.Debug("arturl: %s"%artUrl) if artUrl is not None: art = Function(getArt,url=artUrl) if artUrl == "" or artUrl is None: artUrl = Dict['series'][str(seriesId)]['art'] if artUrl == "" or artUrl is None: artUrl = R(CRUNCHYROLL_ART) else: artUrl = R(CRUNCHYROLL_ART) Log.Debug("artUrl: %s"%artUrl) return artUrl
def getSeasonThumb(tvdbId, season, rand=True): """ pass it along to fanart scrapper """ return fanartScrapper.getSeasonThumb(tvdbId, season, rand)