feat: Add TMDB ID detection for movies without IMDb IDs
Local Docker Build (Dev) / build-dev (push) Successful in 23s

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 <uniqueid type="tmdb"> 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.
This commit is contained in:
2025-09-24 12:36:16 -04:00
parent d6d24e8840
commit ea661bcd45
+11
View File
@@ -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