From 98634f72086d327747f32c8cfa4e4503d500475a Mon Sep 17 00:00:00 2001 From: Tyler Hoang Date: Wed, 6 May 2026 16:28:27 -0700 Subject: Fix director biography fetching - Use person details endpoint instead of search to get full biography - Search endpoint only returns truncated/partial biography - Now correctly fetches complete biography from TMDB Co-Authored-By: Claude Haiku 4.5 --- services/tmdb.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'services/tmdb.py') diff --git a/services/tmdb.py b/services/tmdb.py index e749f09..3618168 100644 --- a/services/tmdb.py +++ b/services/tmdb.py @@ -224,9 +224,19 @@ async def director_info(director_name: str, key: str | None = None, client: http if not results: return {"image": None, "biography": None} - person = results[0] - image = poster_url(person.get("profile_path")) - biography = (person.get("biography") or "").strip() or None + person_id = results[0].get("id") + image = poster_url(results[0].get("profile_path")) + + # Fetch full person details to get biography + biography = None + if person_id: + detail_response = await active_client.get( + f"https://api.themoviedb.org/3/person/{person_id}", + params={"api_key": key or api_key()}, + ) + if detail_response.status_code == 200: + person_detail = detail_response.json() + biography = (person_detail.get("biography") or "").strip() or None return {"image": image, "biography": biography} except Exception: -- cgit v1.3-2-g0d8e