debug: Add IMDb ID detection logging and database-first optimization
Local Docker Build (Dev) / build-dev (push) Successful in 18s
Local Docker Build (Dev) / build-dev (push) Successful in 18s
Added comprehensive debugging for IMDb ID detection to identify issues with directories that don't have IMDb IDs in folder names but do have them in filenames (like Adulthood (2025) [tt26657977]). Also added database-first optimization that skips expensive API calls when we already have complete data in the database. This should: - Speed up full rescans significantly - Reduce unnecessary API calls to TMDB/OMDB/Radarr - Keep database size appropriate by not re-querying known movies This should resolve both the small database size issue and improve performance for movies that already have valid dateadded entries.
This commit is contained in:
+6
-1
@@ -88,9 +88,12 @@ class NFOManager:
|
||||
|
||||
def find_movie_imdb_id(self, movie_dir: Path) -> Optional[str]:
|
||||
"""Find IMDb ID from directory name, filenames, or NFO file"""
|
||||
print(f"🔍 Searching for IMDb ID in: {movie_dir.name}")
|
||||
|
||||
# First try directory name
|
||||
imdb_id = self.parse_imdb_from_path(movie_dir)
|
||||
if imdb_id:
|
||||
print(f"✅ Found IMDb ID in directory name: {imdb_id}")
|
||||
return imdb_id
|
||||
|
||||
# Try all files in the directory for IMDb ID patterns
|
||||
@@ -98,15 +101,17 @@ class NFOManager:
|
||||
if file_path.is_file():
|
||||
imdb_id = self.parse_imdb_from_path(file_path)
|
||||
if imdb_id:
|
||||
print(f"✅ Found IMDb ID in filename: {imdb_id} from {file_path.name}")
|
||||
return imdb_id
|
||||
|
||||
# Finally, try NFO file content
|
||||
nfo_path = movie_dir / "movie.nfo"
|
||||
imdb_id = self.parse_imdb_from_nfo(nfo_path)
|
||||
if imdb_id:
|
||||
print(f"🔍 Found IMDb ID in NFO file: {imdb_id} from {nfo_path}")
|
||||
print(f"✅ Found IMDb ID in NFO file: {imdb_id} from {nfo_path}")
|
||||
return imdb_id
|
||||
|
||||
print(f"❌ No IMDb ID found in directory, filenames, or NFO for: {movie_dir.name}")
|
||||
return None
|
||||
|
||||
def _parse_nfo_with_tolerance(self, nfo_path: Path):
|
||||
|
||||
Reference in New Issue
Block a user