updates: apply channel now installs latest version from selected channel
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
<setting id="update_channel" type="enum" label="Update-Kanal" default="1" values="Main|Nightly|Custom" />
|
||||
<setting id="apply_update_channel" type="action" label="Update-Kanal jetzt anwenden" action="RunPlugin(plugin://plugin.video.viewit/?action=apply_update_channel)" option="close" />
|
||||
<setting id="auto_update_enabled" type="bool" label="Automatische Updates (beim Start pruefen)" default="false" />
|
||||
<setting id="run_update_check" type="action" label="Jetzt nach Updates suchen" action="RunPlugin(plugin://plugin.video.viewit/?action=check_updates)" option="close" />
|
||||
<setting id="select_update_version" type="action" label="Version waehlen und installieren" action="RunPlugin(plugin://plugin.video.viewit/?action=select_update_version)" option="close" />
|
||||
<setting id="update_installed_version" type="text" label="Installierte Version" default="-" enable="false" />
|
||||
<setting id="update_available_selected" type="text" label="Verfuegbar (gewaehlter Kanal)" default="-" enable="false" />
|
||||
|
||||
Reference in New Issue
Block a user