Filter TBA episodes
This commit is contained in:
@@ -169,6 +169,12 @@ def _normalize_search_text(value: str) -> str:
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
def _is_episode_tba(title: str, original_title: str) -> bool:
|
||||||
|
combined = f"{title} {original_title}".casefold()
|
||||||
|
markers = ("tba", "demnächst", "demnaechst", "coming soon", "to be announced")
|
||||||
|
return any(marker in combined for marker in markers)
|
||||||
|
|
||||||
|
|
||||||
def _get_setting_bool(setting_id: str, *, default: bool = False) -> bool:
|
def _get_setting_bool(setting_id: str, *, default: bool = False) -> bool:
|
||||||
return get_setting_bool(ADDON_ID, setting_id, default=default)
|
return get_setting_bool(ADDON_ID, setting_id, default=default)
|
||||||
|
|
||||||
@@ -430,6 +436,8 @@ def _extract_episodes(soup: BeautifulSoupT) -> List[EpisodeInfo]:
|
|||||||
original_title = (original_tag.get_text(strip=True) if original_tag else "").strip()
|
original_title = (original_tag.get_text(strip=True) if original_tag else "").strip()
|
||||||
if not title:
|
if not title:
|
||||||
title = f"Episode {number}"
|
title = f"Episode {number}"
|
||||||
|
if _is_episode_tba(title, original_title):
|
||||||
|
continue
|
||||||
|
|
||||||
hosters: List[str] = []
|
hosters: List[str] = []
|
||||||
for img in row.select(".episode-watch-cell img"):
|
for img in row.select(".episode-watch-cell img"):
|
||||||
|
|||||||
Reference in New Issue
Block a user