dev: show full series info already in title selection
This commit is contained in:
@@ -1120,6 +1120,7 @@ class SerienstreamPlugin(BasisPlugin):
|
||||
self._latest_cache: Dict[int, List[LatestEpisode]] = {}
|
||||
self._latest_hoster_cache: Dict[str, List[str]] = {}
|
||||
self._series_metadata_cache: Dict[str, Tuple[Dict[str, str], Dict[str, str]]] = {}
|
||||
self._series_metadata_full: set[str] = set()
|
||||
self.is_available = True
|
||||
self.unavailable_reason: Optional[str] = None
|
||||
if not self._requests_available: # pragma: no cover - optional dependency
|
||||
@@ -1736,6 +1737,7 @@ class SerienstreamPlugin(BasisPlugin):
|
||||
cache_key = self._metadata_cache_key(title)
|
||||
if info_labels or art:
|
||||
self._series_metadata_cache[cache_key] = (info_labels, art)
|
||||
self._series_metadata_full.add(cache_key)
|
||||
|
||||
base_series_url = _series_root_url(_extract_canonical_url(series_soup, series.url))
|
||||
season_links = _extract_season_links(series_soup)
|
||||
@@ -1771,7 +1773,7 @@ class SerienstreamPlugin(BasisPlugin):
|
||||
|
||||
cache_key = self._metadata_cache_key(title)
|
||||
cached = self._series_metadata_cache.get(cache_key)
|
||||
if cached is not None:
|
||||
if cached is not None and cache_key in self._series_metadata_full:
|
||||
info, art = cached
|
||||
return dict(info), dict(art), None
|
||||
|
||||
@@ -1781,12 +1783,14 @@ class SerienstreamPlugin(BasisPlugin):
|
||||
self._series_metadata_cache[cache_key] = (dict(info), {})
|
||||
return info, {}, None
|
||||
|
||||
info: Dict[str, str] = {"title": title}
|
||||
art: Dict[str, str] = {}
|
||||
info: Dict[str, str] = dict(cached[0]) if cached else {"title": title}
|
||||
art: Dict[str, str] = dict(cached[1]) if cached else {}
|
||||
info.setdefault("title", title)
|
||||
if series.description:
|
||||
info["plot"] = series.description
|
||||
info.setdefault("plot", series.description)
|
||||
|
||||
# Fuer Listenansichten laden wir pro Seite die Detail-Metadaten vollständig nach.
|
||||
# Fuer Listenansichten laden wir pro Seite die Detail-Metadaten vollstaendig nach.
|
||||
loaded_full = False
|
||||
try:
|
||||
soup = _get_soup(series.url, session=get_requests_session("serienstream", headers=HEADERS))
|
||||
parsed_info, parsed_art = _extract_series_metadata(soup)
|
||||
@@ -1794,10 +1798,13 @@ class SerienstreamPlugin(BasisPlugin):
|
||||
info.update(parsed_info)
|
||||
if parsed_art:
|
||||
art.update(parsed_art)
|
||||
loaded_full = True
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
self._series_metadata_cache[cache_key] = (dict(info), dict(art))
|
||||
if loaded_full:
|
||||
self._series_metadata_full.add(cache_key)
|
||||
return info, art, None
|
||||
|
||||
def series_url_for_title(self, title: str) -> str:
|
||||
@@ -1868,6 +1875,8 @@ class SerienstreamPlugin(BasisPlugin):
|
||||
self._season_links_cache.clear()
|
||||
self._episode_label_cache.clear()
|
||||
self._catalog_cache = None
|
||||
self._series_metadata_cache.clear()
|
||||
self._series_metadata_full.clear()
|
||||
return []
|
||||
if not self._requests_available:
|
||||
raise RuntimeError("SerienstreamPlugin kann ohne requests/bs4 nicht suchen.")
|
||||
@@ -1881,6 +1890,8 @@ class SerienstreamPlugin(BasisPlugin):
|
||||
self._season_cache.clear()
|
||||
self._episode_label_cache.clear()
|
||||
self._catalog_cache = None
|
||||
self._series_metadata_cache.clear()
|
||||
self._series_metadata_full.clear()
|
||||
raise RuntimeError(f"Serienstream-Suche fehlgeschlagen: {exc}") from exc
|
||||
self._series_results = {}
|
||||
for result in results:
|
||||
|
||||
Reference in New Issue
Block a user