Esempio n. 1
0
def hourly(type=0):
    if type < 2:
        download_files()

    if type > 0:
        if api.test_channels(tested=False) < 5:
            api.test_channels(tested=True)
Esempio n. 2
0
def _reset(**kwargs):
    if not gui.yes_no(_.PLUGIN_RESET_YES_NO):
        return

    _close()

    try:
        xbmc.executeJSONRPC(
            '{{"jsonrpc":"2.0","id":1,"method":"Addons.SetAddonEnabled","params":{{"addonid":"{}","enabled":false}}}}'
            .format(ADDON_ID))
        proxyport = settings.getInt(key='_proxyserver_port')

        shutil.rmtree(ADDON_PROFILE)

        settings.setInt(key='_proxyserver_port', value=proxyport)

        system, arch = get_system_arch()
        settings.set(key="_system", value=system)
        settings.set(key="_arch", value=arch)

        download_files()
        update_settings()
        change_icon()

    except:
        pass

    xbmc.executeJSONRPC(
        '{{"jsonrpc":"2.0","id":1,"method":"Addons.SetAddonEnabled","params":{{"addonid":"{}","enabled":true}}}}'
        .format(ADDON_ID))

    gui.notification(_.PLUGIN_RESET_OK)
    signals.emit(signals.AFTER_RESET)
    gui.refresh()
Esempio n. 3
0
def _reset(**kwargs):
    if not gui.yes_no(_.PLUGIN_RESET_YES_NO):
        return

    _close()

    try:
        xbmc.executeJSONRPC(
            '{{"jsonrpc":"2.0","id":1,"method":"Addons.SetAddonEnabled","params":{{"addonid":"{}","enabled":false}}}}'
            .format(ADDON_ID))

        profile_settings = load_profile(profile_id=1)
        proxyserver_port = int(profile_settings['proxyserver_port'])
        system = profile_settings['system']
        arch = profile_settings['arch']

        shutil.rmtree(ADDON_PROFILE)

        directory = os.path.dirname(ADDON_PROFILE + os.sep + "images")

        try:
            if not os.path.exists(directory):
                os.makedirs(directory)
        except:
            pass

        directory = os.path.dirname(ADDON_PROFILE + os.sep + "cache")

        try:
            if not os.path.exists(directory):
                os.makedirs(directory)
        except:
            pass

        query = "UPDATE `vars` SET `arch`='{arch}', `system`='{system}', `test_running`=0, `proxyserver_port`={proxyserver_port} WHERE profile_id={profile_id}".format(
            arch=arch,
            system=system,
            proxyserver_port=proxyserver_port,
            profile_id=1)
        query_settings(query=query,
                       return_result=False,
                       return_insert=False,
                       commit=True)

        download_files()
        update_settings()
        update_prefs()
    except:
        pass

    xbmc.executeJSONRPC(
        '{{"jsonrpc":"2.0","id":1,"method":"Addons.SetAddonEnabled","params":{{"addonid":"{}","enabled":true}}}}'
        .format(ADDON_ID))

    gui.notification(_.PLUGIN_RESET_OK)
    signals.emit(signals.AFTER_RESET)
    gui.refresh()
Esempio n. 4
0
def hourly(type=0):
    if type < 2:
        download_files()