def on_play_video(mode, players, params, trakt_ids=None):
    if plugin.get_setting(SETTING_AUTOPATCH, bool) == True: patch("auto")
    assert players
    # Cancel resolve
    action_cancel()
    # Get video link
    use_simple_selector = plugin.get_setting(SETTING_USE_SIMPLE_SELECTOR, bool)
    is_extended = not (use_simple_selector or len(players) == 1)
    if not is_extended: xbmc.executebuiltin("ActivateWindow(busydialog)")
    try:
        selection = get_video_link(players, params, mode, use_simple_selector)
    finally:
        if not is_extended: xbmc.executebuiltin("Dialog.Close(busydialog)")
    if not selection: return
    # Get selection details
    link = selection['path']
    action = selection.get('action', '')
    plugin.log.info('Playing url: %s' % to_utf8(link))
    # Activate link
    if action == "ACTIVATE": action_activate(link)
    elif action == "RUN": action_run(link)
    elif action == "PRERUN": action_prerun(link)
    elif action == "PLAYMEDIA": action_playmedia(link)
    elif action == "PRERUNRETURN": metaplayer().action_prerun(link)
    else:
        if trakt_ids: set_property('script.trakt.ids', json.dumps(trakt_ids))
        return link
    return None
Exemplo n.º 2
0
def main():
    set_property(
        "syncing_library",
        int((time.time() -
             plugin.get_setting(SETTING_UPDATE_LIBRARY_INTERVAL, int) * 60)))
    set_property(
        "updating_library",
        int((time.time() -
             plugin.get_setting(SETTING_UPDATE_LIBRARY_INTERVAL, int) * 60)))
    set_property(
        "updating_library_music",
        int((time.time() -
             plugin.get_setting(SETTING_UPDATE_LIBRARY_INTERVAL, int) * 60)))

    go_idle(15)
    if plugin.get_setting(SETTING_TOTAL_SETUP_DONE, bool) == False:
        xbmc.executebuiltin(
            'RunPlugin(plugin://plugin.video.chappaai/setup/total)')
        plugin.set_setting(SETTING_TOTAL_SETUP_DONE, "true")
    if plugin.get_setting(SETTING_AUTOPATCH, bool) == True:
        patch("auto")
    xbmc.executebuiltin(
        "RunPlugin(plugin://plugin.video.chappaai/movies/batch_add_to_library)"
    )
    next_update = future(0)
    while not xbmc.abortRequested:
        if next_update <= future(0):
            next_update = future(
                plugin.get_setting(SETTING_UPDATE_LIBRARY_INTERVAL, int) * 60 *
                60)
            update_library()
        go_idle(30 * 60)
Exemplo n.º 3
0
def main():
    go_idle(15)
    if plugin.get_setting(SETTING_TOTAL_SETUP_DONE, bool) == False:
        xbmc.executebuiltin(
            'RunPlugin(plugin://plugin.video.metalliq/setup/total)')
        plugin.set_setting(SETTING_TOTAL_SETUP_DONE, "true")
    if plugin.get_setting(SETTING_AUTOPATCH, bool) == True:
        patch("auto")
    xbmc.executebuiltin(
        "RunPlugin(plugin://plugin.video.metalliq/movies/batch_add_to_library)"
    )
    next_update = future(0)
    while not xbmc.abortRequested:
        if next_update <= future(0):
            next_update = future(
                plugin.get_setting(SETTING_UPDATE_LIBRARY_INTERVAL, int) * 60 *
                60)
            update_library()
        go_idle(30 * 60)