def get_extrafanart(self, file_path): '''helper to retrieve the extrafanart path for a kodi media item''' log_msg("metadatautils get_extrafanart called for %s" % file_path) if not self._get_extrafanart: from helpers.extrafanart import get_extrafanart self._get_extrafanart = get_extrafanart return self._get_extrafanart(file_path)
def close(self): '''Cleanup instances''' self._close_called = True self.cache.close() del self.cache if self._addon: del self._addon if self._thetvdb: del self._thetvdb log_msg("Exited")
def __init__(self): '''Initialize and load all our helpers''' self._studiologos_path = "" self.cache = SimpleCache() self.addon = xbmcaddon.Addon(ADDON_ID) self.kodidb = KodiDb() self.omdb = Omdb(self.cache) self.tmdb = Tmdb(self.cache) self.channellogos = ChannelLogos(self.kodidb) self.fanarttv = FanartTv(self.cache) self.imdb = Imdb(self.cache) self.google = GoogleImages(self.cache) self.studiologos = StudioLogos(self.cache) self.animatedart = AnimatedArt(self.cache, self.kodidb) self.thetvdb = TheTvDb() self.musicart = MusicArtwork(self) self.pvrart = PvrArtwork(self) log_msg("Initialized")
def close(self): '''Cleanup instances''' self.close_called = True self.cache.close() self.addon = None del self.addon del self.kodidb del self.omdb del self.tmdb del self.channellogos del self.fanarttv del self.imdb del self.google del self.studiologos del self.animatedart del self.thetvdb del self.musicart del self.pvrart log_msg("Exited")
def get_pvr_artwork(self, title, channel="", genre="", manual_select=False, ignore_cache=False): '''get artwork and mediadetails for PVR entries''' import requests, urllib, random print title.encode('utf8') r = requests.get( 'http://192.168.0.2:8081/api/teleguide/get_arts?title=' + urllib.quote_plus(title.encode('utf8'))) j = r.json() if j['arts']: data = { 'art': { 'fanarts': j['arts'], 'fanart': random.choice(j['arts']), 'thumb': random.choice(j['arts']) }, 'cachestr': "pvr_artwork.%s.%s" % (title.lower(), channel.lower()), 'pvrtitle': title, 'pvrchannel': channel, 'pvrgenre': genre, 'genre': [genre], 'thumbnail': random.choice(j['arts']) } else: data = self.pvrart.get_pvr_artwork(title, channel, genre, manual_select=manual_select, ignore_cache=ignore_cache) log_msg(data) return data
def __init__(self): '''Initialize and load all our helpers''' self.cache = SimpleCache() log_msg("Initialized")