diff --git a/addon/addon.xml b/addon/addon.xml index 92f80c7..9b0d2ea 100644 --- a/addon/addon.xml +++ b/addon/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/addon/default.py b/addon/default.py index 4159178..67d010d 100644 --- a/addon/default.py +++ b/addon/default.py @@ -113,6 +113,10 @@ def _tmdb_prefetch_concurrency() -> int: return max(1, min(20, value)) +def _tmdb_enabled() -> bool: + return _get_setting_bool("tmdb_enabled", default=True) + + def _log(message: str, level: int = xbmc.LOGINFO) -> None: xbmc.log(f"[ViewIt] {message}", level) @@ -548,6 +552,8 @@ def _tmdb_file_log(message: str) -> None: def _tmdb_labels_and_art(title: str) -> tuple[dict[str, str], dict[str, str], list[TmdbCastMember]]: + if not _tmdb_enabled(): + return {}, {}, [] title_key = (title or "").strip().casefold() language = _get_setting_string("tmdb_language").strip() or "de-DE" show_plot = _get_setting_bool("tmdb_show_plot", default=True) @@ -686,10 +692,14 @@ async def _tmdb_labels_and_art_bulk_async( def _tmdb_labels_and_art_bulk( titles: list[str], ) -> dict[str, tuple[dict[str, str], dict[str, str], list[TmdbCastMember]]]: + if not _tmdb_enabled(): + return {} return _run_async(_tmdb_labels_and_art_bulk_async(titles)) def _tmdb_episode_labels_and_art(*, title: str, season_label: str, episode_label: str) -> tuple[dict[str, str], dict[str, str]]: + if not _tmdb_enabled(): + return {"title": episode_label}, {} title_key = (title or "").strip().casefold() tmdb_id = _TMDB_ID_CACHE.get(title_key) if not tmdb_id: @@ -748,6 +758,8 @@ def _tmdb_episode_labels_and_art(*, title: str, season_label: str, episode_label def _tmdb_episode_cast(*, title: str, season_label: str, episode_label: str) -> list[TmdbCastMember]: + if not _tmdb_enabled(): + return [] show_episode_cast = _get_setting_bool("tmdb_show_episode_cast", default=False) if not show_episode_cast: return [] diff --git a/addon/plugins/serienstream_plugin.py b/addon/plugins/serienstream_plugin.py index 0732a40..17a1401 100644 --- a/addon/plugins/serienstream_plugin.py +++ b/addon/plugins/serienstream_plugin.py @@ -175,6 +175,23 @@ def _is_episode_tba(title: str, original_title: str) -> bool: return any(marker in combined for marker in markers) +def _row_is_upcoming(row: BeautifulSoupT) -> bool: + classes = row.get("class") or [] + if isinstance(classes, str): + classes = classes.split() + if "upcoming" in classes: + return True + badge = row.select_one(".badge-upcoming") + if badge and (badge.get_text(" ", strip=True) or "").strip(): + return True + watch_cell = row.select_one(".episode-watch-cell") + if watch_cell: + text = watch_cell.get_text(" ", strip=True).casefold() + if "tba" in text: + return True + return False + + def _get_setting_bool(setting_id: str, *, default: bool = False) -> bool: return get_setting_bool(ADDON_ID, setting_id, default=default) @@ -409,6 +426,8 @@ def _extract_episodes(soup: BeautifulSoupT) -> List[EpisodeInfo]: # Neues Layout (Stand: 2026-01): Episoden-Tabelle mit Zeilen und onclick-URL. rows = soup.select("table.episode-table tbody tr.episode-row") for index, row in enumerate(rows): + if _row_is_upcoming(row): + continue onclick = (row.get("onclick") or "").strip() url = "" if onclick: diff --git a/addon/resources/settings.xml b/addon/resources/settings.xml index fc3e81f..2bb96ef 100644 --- a/addon/resources/settings.xml +++ b/addon/resources/settings.xml @@ -39,6 +39,7 @@ +