diff --git a/addon/default.py b/addon/default.py index 1b27107..e89fb97 100644 --- a/addon/default.py +++ b/addon/default.py @@ -3370,15 +3370,22 @@ def _apply_update_channel(*, silent: bool = False) -> bool: info_url = _resolve_update_info_url() _sync_update_version_settings() applied = _update_repository_source(info_url) + installed_version = _get_setting_string("update_installed_version").strip() or "0.0.0" + versions = _fetch_repo_versions(info_url) + target_version = versions[0] if versions else "-" + + install_result = False + if target_version != "-" and target_version != installed_version: + install_result = _install_addon_version(info_url, target_version) + elif target_version == installed_version: + install_result = True + builtin = getattr(xbmc, "executebuiltin", None) if callable(builtin): builtin("UpdateAddonRepos") builtin("UpdateLocalAddons") if not silent: - if applied: - message = f"Kanal angewendet: {_channel_label(_selected_update_channel())}" - xbmcgui.Dialog().notification("Updates", message, xbmcgui.NOTIFICATION_INFO, 4000) - else: + if not applied: warning_icon = getattr(xbmcgui, "NOTIFICATION_WARNING", xbmcgui.NOTIFICATION_INFO) xbmcgui.Dialog().notification( "Updates", @@ -3386,7 +3393,36 @@ def _apply_update_channel(*, silent: bool = False) -> bool: warning_icon, 5000, ) - return applied + elif target_version == "-": + xbmcgui.Dialog().notification( + "Updates", + "Kanal angewendet, aber keine Version im Kanal gefunden.", + xbmcgui.NOTIFICATION_ERROR, + 5000, + ) + elif not install_result: + xbmcgui.Dialog().notification( + "Updates", + f"Kanal angewendet, Installation von {target_version} fehlgeschlagen.", + xbmcgui.NOTIFICATION_ERROR, + 5000, + ) + elif target_version == installed_version: + xbmcgui.Dialog().notification( + "Updates", + f"Kanal angewendet: {_channel_label(_selected_update_channel())} ({target_version} bereits installiert)", + xbmcgui.NOTIFICATION_INFO, + 4500, + ) + else: + xbmcgui.Dialog().notification( + "Updates", + f"Kanal angewendet: {_channel_label(_selected_update_channel())} -> {target_version} installiert", + xbmcgui.NOTIFICATION_INFO, + 5000, + ) + _sync_update_version_settings() + return applied and install_result def _run_update_check(*, silent: bool = False) -> None: diff --git a/addon/resources/settings.xml b/addon/resources/settings.xml index 6a859ed..75de91d 100644 --- a/addon/resources/settings.xml +++ b/addon/resources/settings.xml @@ -39,7 +39,6 @@ -