コード例 #1
0
def _perform_service_changes(previous_ver, current_ver):
    """Perform actions for an version bump"""
    from resources.lib.common import debug
    debug('Initialize service upgrade operations, from version {} to {})',
          previous_ver, current_ver)
    from resources.lib.upgrade_actions import delete_cache_folder
    delete_cache_folder()
    # Always leave this to last - After the operations set current version
    g.LOCAL_DB.set_value('service_previous_version', current_ver)
コード例 #2
0
def _perform_service_changes(previous_ver, current_ver):
    """Perform actions for an version bump"""
    debug('Initialize service upgrade operations, from version {} to {})',
          previous_ver, current_ver)
    if previous_ver and is_less_version(previous_ver, '1.2.0'):
        # In the version 1.2.0 has been implemented a new cache management
        from resources.lib.upgrade_actions import delete_cache_folder
        delete_cache_folder()
        # In the version 1.2.0 has been implemented in auto-update mode setting the option to disable the feature
        lib_auto_upd_mode = g.ADDON.getSettingInt('lib_auto_upd_mode')
        g.ADDON.setSettingInt('lib_auto_upd_mode', lib_auto_upd_mode + 1)
    # Always leave this to last - After the operations set current version
    g.LOCAL_DB.set_value('service_previous_version', current_ver)
コード例 #3
0
def _perform_service_changes(previous_ver, current_ver):
    """Perform actions for an version bump"""
    LOG.debug('Initialize service upgrade operations, from version {} to {})', previous_ver, current_ver)
    # Clear cache (prevents problems when netflix change data structures)
    G.CACHE.clear()
    if previous_ver and is_less_version(previous_ver, '1.2.0'):
        # In the version 1.2.0 has been implemented a new cache management
        from resources.lib.upgrade_actions import delete_cache_folder
        delete_cache_folder()
        # In the version 1.2.0 has been implemented in auto-update mode setting the option to disable the feature
        try:
            lib_auto_upd_mode = G.ADDON.getSettingInt('lib_auto_upd_mode')
            G.ADDON.setSettingInt('lib_auto_upd_mode', lib_auto_upd_mode + 1)
        except TypeError:
            # In case of a previous rollback this could fails
            G.ADDON.setSettingInt('lib_auto_upd_mode', 1)
    # Always leave this to last - After the operations set current version
    G.LOCAL_DB.set_value('service_previous_version', current_ver)
コード例 #4
0
def _perform_service_changes(previous_ver, current_ver):
    """Perform actions for an version bump"""
    LOG.debug('Initialize service upgrade operations, from version {} to {})', previous_ver, current_ver)
    # Clear cache (prevents problems when netflix change data structures)
    G.CACHE.clear()
    if previous_ver and is_less_version(previous_ver, '1.2.0'):
        # In the version 1.2.0 has been implemented a new cache management
        from resources.lib.upgrade_actions import delete_cache_folder
        delete_cache_folder()
        # In the version 1.2.0 has been implemented in auto-update mode setting the option to disable the feature
        try:
            lib_auto_upd_mode = G.ADDON.getSettingInt('lib_auto_upd_mode')
            with G.SETTINGS_MONITOR.ignore_events(1):
                G.ADDON.setSettingInt('lib_auto_upd_mode', lib_auto_upd_mode + 1)
        except TypeError:
            # In case of a previous rollback this could fails
            with G.SETTINGS_MONITOR.ignore_events(1):
                G.ADDON.setSettingInt('lib_auto_upd_mode', 1)
    if previous_ver and is_less_version(previous_ver, '1.9.0'):
        # In the version 1.9.0 has been changed the COOKIE_ filename with a static filename
        from resources.lib.upgrade_actions import rename_cookie_file
        rename_cookie_file()
    if previous_ver and is_less_version(previous_ver, '1.12.0'):
        # In the version 1.13.0:
        # - 'force_widevine' on setting.xml has been moved
        #   as 'widevine_force_seclev' in TABLE_SESSION with different values:
        force_widevine = G.ADDON.getSettingString('force_widevine')
        # Old values: Disabled|Widevine L3|Widevine L3 (ID-4445)
        # New values: Disabled|L3|L3 (ID 4445)
        if force_widevine == 'Widevine L3':
            G.LOCAL_DB.set_value('widevine_force_seclev', 'L3', table=TABLE_SESSION)
        elif force_widevine == 'Widevine L3 (ID-4445)':
            G.LOCAL_DB.set_value('widevine_force_seclev', 'L3 (ID 4445)', table=TABLE_SESSION)
        # - 'esn' on setting.xml is not more used but if was set the value need to be copied on 'esn' on TABLE_SESSION:
        esn = G.ADDON.getSettingString('esn')
        if esn:
            from resources.lib.utils.esn import set_esn
            set_esn(esn)
        # - 'suspend_settings_monitor' is not more used
        G.LOCAL_DB.delete_key('suspend_settings_monitor')
    # Always leave this to last - After the operations set current version
    G.LOCAL_DB.set_value('service_previous_version', current_ver)