From ea661bcd455f12c57e5b47ab3dda541bff5424b3 Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Wed, 24 Sep 2025 12:36:16 -0400 Subject: [PATCH] feat: Add TMDB ID detection for movies without IMDb IDs Added fallback detection for movies that only have TMDB IDs in NFO files. When no IMDb ID is found, the system now: - Detects TMDB ID from elements - Logs a helpful warning with the TMDB ID for manual lookup - Provides clear guidance that manual IMDb lookup may be needed This helps identify movies like "For the One (2024)" that have TMDB data but are missing IMDb identifiers, allowing users to manually add IMDb IDs to directory names or filenames when available. Future enhancement: Could implement TMDB->IMDb API conversion. --- core/nfo_manager.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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