dev: bump to 0.1.71-dev – Episodentitel und TMDB API-Key-Fix
This commit is contained in:
@@ -177,7 +177,7 @@ def _fetch_and_cache_imdb_id(title_key: str, tmdb_id: int, kind: str) -> str:
|
|||||||
if cached is not None:
|
if cached is not None:
|
||||||
return cached
|
return cached
|
||||||
api_key = _get_setting_string("tmdb_api_key").strip()
|
api_key = _get_setting_string("tmdb_api_key").strip()
|
||||||
if not api_key or not tmdb_id:
|
if not api_key or api_key == "None" or not tmdb_id:
|
||||||
return ""
|
return ""
|
||||||
ext = fetch_external_ids(kind=kind, tmdb_id=tmdb_id, api_key=api_key)
|
ext = fetch_external_ids(kind=kind, tmdb_id=tmdb_id, api_key=api_key)
|
||||||
imdb_id = ext.imdb_id if ext else ""
|
imdb_id = ext.imdb_id if ext else ""
|
||||||
@@ -856,7 +856,7 @@ def _tmdb_labels_and_art(title: str) -> tuple[dict[str, str], dict[str, str], li
|
|||||||
api_key = _get_setting_string("tmdb_api_key").strip()
|
api_key = _get_setting_string("tmdb_api_key").strip()
|
||||||
log_requests = _get_setting_bool("tmdb_log_requests", default=False)
|
log_requests = _get_setting_bool("tmdb_log_requests", default=False)
|
||||||
log_responses = _get_setting_bool("tmdb_log_responses", default=False)
|
log_responses = _get_setting_bool("tmdb_log_responses", default=False)
|
||||||
if api_key:
|
if api_key and api_key != "None":
|
||||||
try:
|
try:
|
||||||
log_fn = _tmdb_file_log if (log_requests or log_responses) else None
|
log_fn = _tmdb_file_log if (log_requests or log_responses) else None
|
||||||
# Einige Plugins liefern Titel wie "… – Der Film". Für TMDB ist oft der Basistitel besser.
|
# Einige Plugins liefern Titel wie "… – Der Film". Für TMDB ist oft der Basistitel besser.
|
||||||
@@ -1002,7 +1002,7 @@ def _tmdb_episode_labels_and_art(*, title: str, season_label: str, episode_label
|
|||||||
cached_season = _tmdb_cache_get(_TMDB_SEASON_CACHE, season_key)
|
cached_season = _tmdb_cache_get(_TMDB_SEASON_CACHE, season_key)
|
||||||
if cached_season is None:
|
if cached_season is None:
|
||||||
api_key = _get_setting_string("tmdb_api_key").strip()
|
api_key = _get_setting_string("tmdb_api_key").strip()
|
||||||
if not api_key:
|
if not api_key or api_key == "None":
|
||||||
return {"title": episode_label}, {}
|
return {"title": episode_label}, {}
|
||||||
log_requests = _get_setting_bool("tmdb_log_requests", default=False)
|
log_requests = _get_setting_bool("tmdb_log_requests", default=False)
|
||||||
log_responses = _get_setting_bool("tmdb_log_responses", default=False)
|
log_responses = _get_setting_bool("tmdb_log_responses", default=False)
|
||||||
@@ -1023,7 +1023,7 @@ def _tmdb_episode_labels_and_art(*, title: str, season_label: str, episode_label
|
|||||||
mapped: dict[int, tuple[dict[str, str], dict[str, str]]] = {}
|
mapped: dict[int, tuple[dict[str, str], dict[str, str]]] = {}
|
||||||
if season_meta:
|
if season_meta:
|
||||||
for ep_no, ep in season_meta.items():
|
for ep_no, ep in season_meta.items():
|
||||||
info: dict[str, str] = {"title": f"Episode {ep_no}"}
|
info: dict[str, str] = {"title": ep.title or f"Episode {ep_no}"}
|
||||||
if show_plot and ep.plot:
|
if show_plot and ep.plot:
|
||||||
info["plot"] = ep.plot
|
info["plot"] = ep.plot
|
||||||
if getattr(ep, "runtime_minutes", 0):
|
if getattr(ep, "runtime_minutes", 0):
|
||||||
@@ -1065,7 +1065,7 @@ def _tmdb_episode_cast(*, title: str, season_label: str, episode_label: str) ->
|
|||||||
return list(cached)
|
return list(cached)
|
||||||
|
|
||||||
api_key = _get_setting_string("tmdb_api_key").strip()
|
api_key = _get_setting_string("tmdb_api_key").strip()
|
||||||
if not api_key:
|
if not api_key or api_key == "None":
|
||||||
_tmdb_cache_set(_TMDB_EPISODE_CAST_CACHE, cache_key, [])
|
_tmdb_cache_set(_TMDB_EPISODE_CAST_CACHE, cache_key, [])
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|||||||
@@ -454,6 +454,7 @@ def lookup_movie(
|
|||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class TmdbEpisodeMeta:
|
class TmdbEpisodeMeta:
|
||||||
|
title: str
|
||||||
plot: str
|
plot: str
|
||||||
thumb: str
|
thumb: str
|
||||||
runtime_minutes: int
|
runtime_minutes: int
|
||||||
@@ -545,6 +546,7 @@ def lookup_tv_season(
|
|||||||
continue
|
continue
|
||||||
if not ep_number:
|
if not ep_number:
|
||||||
continue
|
continue
|
||||||
|
title = (entry.get("name") or "").strip()
|
||||||
plot = (entry.get("overview") or "").strip()
|
plot = (entry.get("overview") or "").strip()
|
||||||
runtime_minutes = 0
|
runtime_minutes = 0
|
||||||
try:
|
try:
|
||||||
@@ -553,9 +555,9 @@ def lookup_tv_season(
|
|||||||
runtime_minutes = 0
|
runtime_minutes = 0
|
||||||
still_path = (entry.get("still_path") or "").strip()
|
still_path = (entry.get("still_path") or "").strip()
|
||||||
thumb = f"{TMDB_IMAGE_BASE}/w300{still_path}" if still_path else ""
|
thumb = f"{TMDB_IMAGE_BASE}/w300{still_path}" if still_path else ""
|
||||||
if not plot and not thumb and not runtime_minutes:
|
if not title and not plot and not thumb and not runtime_minutes:
|
||||||
continue
|
continue
|
||||||
result[ep_number] = TmdbEpisodeMeta(plot=plot, thumb=thumb, runtime_minutes=runtime_minutes)
|
result[ep_number] = TmdbEpisodeMeta(title=title, plot=plot, thumb=thumb, runtime_minutes=runtime_minutes)
|
||||||
return result or None
|
return result or None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user