Beispiel #1
0
def _set_isa_addon_settings(is_4k_capable, hdcp_override):
    """Method for self-configuring of InputStream Adaptive add-on"""
    is_helper = inputstreamhelper.Helper('mpd')
    if not is_helper.check_inputstream():
        show_ok_dialog(get_local_string(30154), get_local_string(30046))
        return
    isa_addon = Addon('inputstream.adaptive')
    isa_addon.setSettingBool('HDCPOVERRIDE', hdcp_override)
    if isa_addon.getSettingInt('STREAMSELECTION') == 1:
        # Stream selection must never be set to 'Manual' or cause problems with the streams
        isa_addon.setSettingInt('STREAMSELECTION', 0)
    # 'Ignore display' should only be set when Kodi display resolution is not 4K
    isa_addon.setSettingBool(
        'IGNOREDISPLAY', is_4k_capable
        and (getScreenWidth() != 3840 or getScreenHeight() != 2160))
def migrate_from_1_to_2(addon: xbmcaddon.Addon) -> int:

    xbmc.log(
        "[script.timers] migrate settings from early version to version 2",
        xbmc.LOGINFO)

    for i in range(TIMERS):
        i_schedule = addon.getSettingInt("timer_%i" % i)
        if i_schedule == 25:
            addon.setSettingInt("timer_%i" % i, 0)
        elif i_schedule == 26:
            addon.setSettingInt("timer_%i" % i, 17)
        elif i_schedule >= 1 and i_schedule <= 15:
            addon.setSettingInt("timer_%i" % i, i_schedule + 1)
        elif i_schedule >= 16 and i_schedule <= 24:
            addon.setSettingInt("timer_%i" % i, i_schedule + 2)

    return 2
def _set_isa_addon_settings(is_4k_capable, hdcp_override):
    """Method for self-configuring of InputStream Adaptive add-on"""
    try:
        is_helper = inputstreamhelper.Helper('mpd')
        if not is_helper.check_inputstream():
            show_ok_dialog(get_local_string(30154), get_local_string(30046))
            return
    except Exception as exc:  # pylint: disable=broad-except
        # Captures all types of ISH internal errors
        import traceback
        LOG.error(G.py2_decode(traceback.format_exc(), 'latin-1'))
        raise_from(InputStreamHelperError(str(exc)), exc)

    isa_addon = Addon('inputstream.adaptive')
    isa_addon.setSettingBool('HDCPOVERRIDE', hdcp_override)
    if isa_addon.getSettingInt('STREAMSELECTION') == 1:
        # Stream selection must never be set to 'Manual' or cause problems with the streams
        isa_addon.setSettingInt('STREAMSELECTION', 0)
    # 'Ignore display' should only be set when Kodi display resolution is not 4K
    isa_addon.setSettingBool('IGNOREDISPLAY', is_4k_capable and (getScreenWidth() != 3840 or getScreenHeight() != 2160))
def reset_volume(addon: xbmcaddon.Addon) -> None:

    vol_default = addon.getSettingInt("vol_default")
    set_volume(vol_default)
    xbmcgui.Dialog().notification(addon.getLocalizedString(
        32027), addon.getLocalizedString(32112))