diff --git a/core/nfo_manager.py b/core/nfo_manager.py index 743b93d..9d72a1f 100644 --- a/core/nfo_manager.py +++ b/core/nfo_manager.py @@ -79,6 +79,17 @@ class NFOManager: imdb_id = imdb_elem.text.strip() if imdb_id.startswith('tt'): return imdb_id + + # Last resort: Check for TMDB ID and try to convert via external lookup + # This handles movies that only have TMDB IDs in NFO files + tmdb_uniqueid = root.find('.//uniqueid[@type="tmdb"]') + if tmdb_uniqueid is not None and tmdb_uniqueid.text: + tmdb_id = tmdb_uniqueid.text.strip() + if tmdb_id.isdigit(): + print(f"⚠️ Found TMDB ID {tmdb_id} but no IMDb ID - this movie may need manual IMDb lookup") + # TODO: Could implement TMDB->IMDb conversion via API + # For now, log the TMDB ID so user can manually look it up + return None except (ET.ParseError, Exception): # Skip corrupted or non-XML files