feat: Add TMDB ID detection for movies without IMDb IDs
Local Docker Build (Dev) / build-dev (push) Successful in 23s
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:
@@ -80,6 +80,17 @@ class NFOManager:
|
||||
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
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user