Exemplo n.º 1
0
def update_library():
    now = time.time()
    is_syncing = plugin.getProperty('openmeta_syncing_library')
    is_updating = plugin.getProperty('openmeta_updating_library')
    if is_syncing and now - int(is_syncing) < 120:
        plugin.log.debug('Skipping library sync')
    else:
        if plugin.get_setting('library_sync_collection', bool) == True:
            try:
                plugin.setProperty('openmeta_syncing_library', int(now))
                plugin.notify('OpenMeta', 'Syncing library',
                              plugin.get_addon_icon(), 1000)
                lib_tvshows.sync_trakt_collection()
                lib_movies.sync_trakt_collection()
            finally:
                plugin.clearProperty('openmeta_syncing_library')
    if is_updating and now - int(is_updating) < 120:
        plugin.log.debug('Skipping library update')
        return
    else:
        if plugin.get_setting('library_updates', bool) == True:
            try:
                plugin.setProperty('openmeta_updating_library', int(now))
                plugin.notify('OpenMeta', 'Updating library',
                              plugin.get_addon_icon(), 1000)
                lib_tvshows.update_library()
            finally:
                plugin.clearProperty('openmeta_updating_library')
Exemplo n.º 2
0
def tv_play(id, season, episode, usedefault='True'):
    playaction = plugin.get_setting('tvshows_default_action', int)
    if playaction == 1 and xbmc.getCondVisibility(
            'system.hasaddon(script.extendedinfo)'
    ) and not plugin.getProperty('infodialogs.active'):
        from resources.lib.play_base import action_cancel
        action_cancel()
        xbmc.executebuiltin(
            'RunScript(script.extendedinfo,info=extendedtvinfo,tvdb_id=%s)' %
            (id))
    elif playaction == 2 and xbmc.getCondVisibility(
            'system.hasaddon(script.extendedinfo)'
    ) and not plugin.getProperty('infodialogs.active'):
        from resources.lib.play_base import action_cancel
        action_cancel()
        xbmc.executebuiltin(
            'RunScript(script.extendedinfo,info=extendedepisodeinfo,tvdb_id=%s,season=%s,episode=%s)'
            % (id, season, episode))
    else:
        play_tvshows.play_episode(id, season, episode, usedefault)
Exemplo n.º 3
0
 def currently_playing(self):
     video_data = plugin.getProperty('plugin.video.chappaai.data')
     if video_data:
         try:
             video_data = json.loads(video_data)
             return self.get_episode_id(video_data.get('dbid'),
                                        video_data['tvdb'],
                                        video_data['season'],
                                        video_data['episode'])
         except KeyError:
             pass
     return None
Exemplo n.º 4
0
def movies_play(src, id, usedefault='True'):
    playaction = plugin.get_setting('movies_default_action', int)
    if playaction == 1 and xbmc.getCondVisibility(
            'system.hasaddon(script.KodiTVRinfo)'
    ) and not plugin.getProperty('infodialogs.active'):
        from resources.lib.play_base import action_cancel
        action_cancel()
        src = 'id' if src == 'tmdb' else 'imdb_id'
        xbmc.executebuiltin(
            'RunScript(script.KodiTVRinfo,info=KodiTVRinfo,%s=%s)' % (src, id))
    else:
        movies_play_choose_player(src, id, usedefault)