Add TMDB master toggle and filter upcoming episodes
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user