diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-06 16:28:27 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-06 16:28:27 -0700 |
| commit | 98634f72086d327747f32c8cfa4e4503d500475a (patch) | |
| tree | fa3028210d367ca08916243cd2b8387a12b6d3b6 /services | |
| parent | 138eaaa12cdaeb6035951ff4f1547d73e8d12612 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'services')
| -rw-r--r-- | services/tmdb.py | 16 |
1 files changed, 13 insertions, 3 deletions
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: |
