Pass series URLs through navigation for faster serienstream
This commit is contained in:
@@ -835,6 +835,17 @@ class SerienstreamPlugin(BasisPlugin):
|
||||
if cached is not None:
|
||||
return list(cached)
|
||||
series = self._series_results.get(title)
|
||||
if not series:
|
||||
catalog = self._ensure_catalog()
|
||||
lookup_key = title.casefold().strip()
|
||||
for entries in catalog.values():
|
||||
for entry in entries:
|
||||
if entry.title.casefold().strip() == lookup_key:
|
||||
series = entry
|
||||
self._series_results[entry.title] = entry
|
||||
break
|
||||
if series:
|
||||
break
|
||||
if not series:
|
||||
return []
|
||||
try:
|
||||
@@ -844,6 +855,26 @@ class SerienstreamPlugin(BasisPlugin):
|
||||
self._season_links_cache[title] = list(seasons)
|
||||
return list(seasons)
|
||||
|
||||
def remember_series_url(self, title: str, series_url: str) -> None:
|
||||
title = (title or "").strip()
|
||||
series_url = (series_url or "").strip()
|
||||
if not title or not series_url:
|
||||
return
|
||||
self._series_results[title] = SeriesResult(title=title, description="", url=series_url)
|
||||
|
||||
def series_url_for_title(self, title: str) -> str:
|
||||
title = (title or "").strip()
|
||||
if not title:
|
||||
return ""
|
||||
direct = self._series_results.get(title)
|
||||
if direct and direct.url:
|
||||
return direct.url
|
||||
lookup_key = title.casefold().strip()
|
||||
for entry in self._series_results.values():
|
||||
if entry.title.casefold().strip() == lookup_key and entry.url:
|
||||
return entry.url
|
||||
return ""
|
||||
|
||||
def _ensure_season_episodes(self, title: str, season_number: int) -> Optional[SeasonInfo]:
|
||||
seasons = self._season_cache.get(title) or []
|
||||
for season in seasons:
|
||||
|
||||
Reference in New Issue
Block a user