dev: bump to 0.1.72-dev – Autoplay-Setting, Moflix Hoster-Dialog, Update-Hinweis im Hauptmenue

This commit is contained in:
2026-03-06 21:05:53 +01:00
parent 957a5a1aea
commit 6e7b4c3d39
13 changed files with 473 additions and 205 deletions

View File

@@ -1203,7 +1203,7 @@ def _normalize_update_info_url(raw: str) -> str:
UPDATE_CHANNEL_MAIN = 0
UPDATE_CHANNEL_NIGHTLY = 1
UPDATE_CHANNEL_CUSTOM = 2
AUTO_UPDATE_INTERVAL_SEC = 6 * 60 * 60
_AUTO_UPDATE_INTERVALS = [1 * 60 * 60, 6 * 60 * 60, 24 * 60 * 60] # 1h, 6h, 24h
UPDATE_HTTP_TIMEOUT_SEC = 8
UPDATE_ADDON_ID = "plugin.video.viewit"
RESOLVEURL_ADDON_ID = "script.module.resolveurl"
@@ -1644,6 +1644,17 @@ def _sync_update_version_settings() -> None:
def _show_root_menu() -> None:
handle = _get_handle()
_log("Root-Menue wird angezeigt.")
# Update-Hinweis ganz oben wenn neuere Version verfügbar
installed = _get_setting_string("update_installed_version").strip()
available = _get_setting_string("update_available_selected").strip()
if installed and available and available not in ("-", "", "0.0.0") and installed != available:
_add_directory_item(
handle,
f"Update verfuegbar: {installed} -> {available}",
"select_update_version",
)
_add_directory_item(handle, "Suche in allen Quellen", "search")
plugins = _discover_plugins()
@@ -3762,18 +3773,11 @@ def _show_version_selector() -> None:
except Exception:
pass
dialog = xbmcgui.Dialog()
try:
confirmed = dialog.yesno(
"Version installieren",
f"Installiert: {installed}",
f"Ausgewaehlt: {version}",
yeslabel="Installieren",
nolabel="Abbrechen",
)
except TypeError:
confirmed = dialog.yesno("Version installieren", f"Installiert: {installed}", f"Ausgewaehlt: {version}")
if not confirmed:
action = xbmcgui.Dialog().select(
f"Version {version} installieren?",
["Update installieren", "Abbrechen"],
)
if action != 0:
return
xbmcgui.Dialog().notification("Updates", f"Installation gestartet: {version}", xbmcgui.NOTIFICATION_INFO, 2500)
@@ -3794,7 +3798,9 @@ def _maybe_run_auto_update_check(action: str | None) -> None:
return
now = int(time.time())
last = _get_setting_int("auto_update_last_ts", default=0)
if last > 0 and (now - last) < AUTO_UPDATE_INTERVAL_SEC:
interval_idx = _get_setting_int("auto_update_interval", default=1)
interval_sec = _AUTO_UPDATE_INTERVALS[min(interval_idx, len(_AUTO_UPDATE_INTERVALS) - 1)]
if last > 0 and (now - last) < interval_sec:
return
_set_setting_string("auto_update_last_ts", str(now))
_run_update_check(silent=True)
@@ -4038,12 +4044,23 @@ def _play_episode(
selected_hoster: str | None = None
forced_hoster = (forced_hoster or "").strip()
autoplay = _get_setting_bool("autoplay_enabled", default=False)
preferred = _get_setting_string("preferred_hoster").strip()
if available_hosters:
if forced_hoster:
for hoster in available_hosters:
if hoster.casefold() == forced_hoster.casefold():
selected_hoster = hoster
break
if selected_hoster is None and autoplay and preferred:
pref_lower = preferred.casefold()
for hoster in available_hosters:
if pref_lower in hoster.casefold():
selected_hoster = hoster
break
if selected_hoster is None:
selected_hoster = available_hosters[0]
_log(f"Autoplay: bevorzugter Hoster '{preferred}' nicht gefunden, nutze '{selected_hoster}'.", xbmc.LOGDEBUG)
if selected_hoster is None and len(available_hosters) == 1:
selected_hoster = available_hosters[0]
elif selected_hoster is None:
@@ -4180,10 +4197,21 @@ def _play_episode_url(
_log(f"Hoster laden fehlgeschlagen ({plugin_name}): {exc}", xbmc.LOGWARNING)
selected_hoster: str | None = None
autoplay = _get_setting_bool("autoplay_enabled", default=False)
preferred = _get_setting_string("preferred_hoster").strip()
if available_hosters:
if len(available_hosters) == 1:
if autoplay and preferred:
pref_lower = preferred.casefold()
for hoster in available_hosters:
if pref_lower in hoster.casefold():
selected_hoster = hoster
break
if selected_hoster is None:
selected_hoster = available_hosters[0]
_log(f"Autoplay: bevorzugter Hoster '{preferred}' nicht gefunden, nutze '{selected_hoster}'.", xbmc.LOGDEBUG)
if selected_hoster is None and len(available_hosters) == 1:
selected_hoster = available_hosters[0]
else:
elif selected_hoster is None:
selected_index = xbmcgui.Dialog().select("Hoster waehlen", available_hosters)
if selected_index is None or selected_index < 0:
_log("Play abgebrochen (kein Hoster gewählt).", xbmc.LOGDEBUG)