updates: apply channel now installs latest version from selected channel

This commit is contained in:
2026-02-23 20:47:18 +01:00
parent d876d5b84c
commit 75a7df8361
2 changed files with 41 additions and 6 deletions

View File

@@ -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: