dev: bump to 0.1.86.5-dev Globale Suche konfigurierbar, Changelog-Dialog beim ersten Start

This commit is contained in:
2026-04-03 12:49:17 +02:00
parent b0706befdb
commit ab05040335
7 changed files with 349 additions and 4 deletions

View File

@@ -2189,6 +2189,29 @@ def _clean_search_titles(values: list[str]) -> list[str]:
return cleaned
_SEARCH_PLUGIN_SETTING_IDS: dict[str, str] = {
"Serienstream": "search_plugin_serienstream",
"Aniworld": "search_plugin_aniworld",
"Topstreamfilm": "search_plugin_topstreamfilm",
"Filmpalast": "search_plugin_filmpalast",
"Moflix": "search_plugin_moflix",
"KKiste": "search_plugin_kkiste",
"HDFilme": "search_plugin_hdfilme",
"Einschalten": "search_plugin_einschalten",
"Doku-Streams": "search_plugin_doku_streams",
"NetzkKino": "search_plugin_netzkino",
"YouTube": "search_plugin_youtube",
}
def _plugin_search_enabled(plugin_name: str) -> bool:
"""Gibt True zurück wenn das Plugin in der globalen Suche aktiv ist."""
setting_id = _SEARCH_PLUGIN_SETTING_IDS.get(plugin_name)
if setting_id is None:
return True # unbekannte Plugins standardmäßig einschließen
return _get_setting_bool(setting_id, default=True)
def _show_search() -> None:
_log("Suche gestartet.")
dialog = xbmcgui.Dialog()
@@ -2213,7 +2236,7 @@ def _show_search_results(query: str) -> None:
# grouped: casefold-key → Liste der Plugin-Einträge für diesen Titel
grouped: dict[str, list[dict[str, object]]] = {}
canceled = False
plugin_entries = list(plugins.items())
plugin_entries = [(n, p) for n, p in plugins.items() if _plugin_search_enabled(n)]
total_plugins = max(1, len(plugin_entries))
with _progress_dialog("Suche laeuft", "Suche startet...") as progress:
for plugin_index, (plugin_name, plugin) in enumerate(plugin_entries, start=1):
@@ -2318,7 +2341,7 @@ def _show_search_results(query: str) -> None:
# Nur ein Plugin → direkt zur Staffel-Ansicht
direct_play = bool(first["direct_play"])
list_items.append({
"label": first["label_base"],
"label": f"{first['label_base']} [{first['plugin_name']}]",
"action": "play_movie" if direct_play else "seasons",
"params": {"plugin": first["plugin_name"], "title": canonical_title, **dict(first["extra_params"])},
"is_folder": not direct_play,
@@ -2329,8 +2352,9 @@ def _show_search_results(query: str) -> None:
else:
# Mehrere Plugins → Zwischenstufe "Quelle wählen"
plugin_list = ",".join(str(e["plugin_name"]) for e in entries)
provider_label = ", ".join(str(e["plugin_name"]) for e in entries)
list_items.append({
"label": first["label_base"],
"label": f"{first['label_base']} [{provider_label}]",
"action": "choose_source",
"params": {"title": canonical_title, "plugins": plugin_list},
"is_folder": True,
@@ -5559,6 +5583,38 @@ def _route_fallback(params: dict[str, str]) -> None:
_show_root_menu()
def _maybe_show_changelog() -> None:
"""Zeigt beim ersten Start nach einem Update das Benutzer-Changelog an."""
try:
current_version = str(_get_addon().getAddonInfo("version") or "").strip()
last_shown = _get_setting_string("changelog_last_shown_version").strip()
if not current_version or current_version == last_shown:
return
changelog_path = Path(__file__).parent / "CHANGELOG-USER.md"
if not changelog_path.exists():
return
text = changelog_path.read_text(encoding="utf-8")
# Ersten Abschnitt (neueste Version) extrahieren
lines = text.splitlines()
section: list[str] = []
for line in lines:
if line.startswith("## ") and section:
break
section.append(line)
content = "\n".join(section).strip()
if not content:
return
viewer = getattr(xbmcgui.Dialog(), "textviewer", None)
if callable(viewer):
try:
viewer("Was ist neu?", content)
except Exception:
pass
_get_addon().setSetting("changelog_last_shown_version", current_version)
except Exception as exc:
_log(f"Changelog-Anzeige fehlgeschlagen: {exc}", xbmc.LOGWARNING)
def run() -> None:
params = _parse_params()
action = params.get("action")
@@ -5566,6 +5622,8 @@ def run() -> None:
_maybe_run_auto_update_check(action)
_maybe_auto_install_resolveurl(action)
_sync_trakt_status_setting()
if not action:
_maybe_show_changelog()
_router.dispatch(action=action, params=params)