fix(api): add TMDB ID enrichment for KP content via IMDB ID lookup

- Add TMDBID field to ExternalIDs model
- Enhance GetExternalIDs in MovieService and TVService to fetch TMDB ID via FindTMDBIdByIMDB
- Add EnrichKPWithTMDBID function to enrich unified content with TMDB IDs
- Update unified handlers to automatically enrich KP content with TMDB IDs
- Enrich search results with TMDB IDs by fetching full film data for each result

This ensures that when using source=kp, the response includes TMDB IDs in externalIds
when available through IMDB ID mapping, while preserving all original KP data.
This commit is contained in:
2025-10-19 12:48:11 +00:00
parent b86c9fc340
commit 33572b0cff
5 changed files with 98 additions and 1 deletions

View File

@@ -123,6 +123,7 @@ type ExternalIDs struct {
ID int `json:"id"`
IMDbID string `json:"imdb_id"`
KinopoiskID int `json:"kinopoisk_id,omitempty"`
TMDBID int `json:"tmdb_id,omitempty"`
TVDBID int `json:"tvdb_id,omitempty"`
WikidataID string `json:"wikidata_id"`
FacebookID string `json:"facebook_id"`