Esempio n. 1
0
def main_menu():
    from helpers.helperclasses import EPG
    from yelo import Yelo
    if EPG().is_enabled and EPG().is_cached:
        Yelo().list_channels()
    else:
        Yelo().list_channels_without_epg()
Esempio n. 2
0
    def cache_channel_epg(cls):
        if PluginCache.key_exists("entitlements"):
            _LOGGER.debug('Caching channels..')

            channels = YeloApi.get_channels()

            epg = YeloApi.get_epg(channels)
            EPG.to_cache(epg)

            KodiWrapper.set_setting('metadata_last_updated', str(int(time())))

            sleep(1)
            KodiWrapper.container_refresh()
Esempio n. 3
0
    def run(self):
        _LOGGER.debug('Service started')

        while not self.abortRequested():
            # Update every `update_interval` after the last update
            if EPG().is_enabled and int(KodiWrapper.get_setting('metadata_last_updated', 0)) \
                    + self.update_interval < time():
                self.cache_channel_epg()

            # Stop when abort requested
            if self.waitForAbort(10):
                break

        _LOGGER.debug('Service stopped')
Esempio n. 4
0
 def get_cached_epg():
     return EPG.get_from_cache()
Esempio n. 5
0
def main_menu():
    if EPG().is_enabled and EPG().is_cached:
        yelo.list_channels()
    else:
        yelo.list_channels_without_epg()
Esempio n. 6
0
def main_menu():
    if EPG().is_enabled():
        yelo.list_channels()
    else:
        yelo.list_channels_no_epg()