예제 #1
0
 def _init_cache(self):
     if not os.path.exists(
             xbmc.translatePath(self.CACHE_PATH).decode('utf-8')):
         self._init_filesystem_cache()
     # This is ugly: Pass the common module into Cache.__init__ to work
     # around circular import dependencies.
     import resources.lib.common as common
     self.CACHE = cache.Cache(common, self.CACHE_PATH, self.CACHE_TTL,
                              self.CACHE_METADATA_TTL, self.PLUGIN_HANDLE)
예제 #2
0
    for genre in __genrescache__.get()[0]:
        if genre['guide_id'] == id:
            return genre['text']
    return ''

# Set some global values.
__xbmcrevision__ = xbmc.getInfoLabel('System.BuildVersion')
__addonid__ = 'plugin.audio.tuneinradio'
__partnerid__ = 'yvcOjvJP'
__author__ = 'Brian Hornsby'

# Initialise settings.
__settings__ = settings.Settings(__addonid__, sys.argv)

# Initialise caches.
_recentscache = cache.Cache(
    __settings__.get_datapath(), 'recents.db', __settings__.get('recents'))
__downloadscache__ = cache.Cache(__settings__.get_datapath(), 'downloads.db')
__showscache__ = cache.Cache(__settings__.get_datapath(), 'shows.db')
__genrescache__ = cache.Cache(__settings__.get_datapath(), 'genres.db')
__formatscache__ = cache.Cache(__settings__.get_datapath(), 'formats.db')

# Get addon information.
__addonname__ = __settings__.get_name()
__version__ = __settings__.get_version()

# Get addon settings values.
__username__ = __settings__.get('username')
__password__ = __settings__.get('password')
__latlon__ = __settings__.get('latlon')
__locale__ = __settings__.get('locale')
__iconcolour__ = __settings__.get('iconcolour')