Add TMDB master toggle and filter upcoming episodes

This commit is contained in:
2026-02-01 20:05:28 +01:00
parent 4d74755e20
commit fe79cca818
4 changed files with 33 additions and 1 deletions

View File

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