From a326825347cce68e4b8dcfa3359f62ad3aad803a Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Mon, 3 Nov 2025 19:49:26 -0500 Subject: [PATCH] update: movie missing imdb --- VERSION | 2 +- core/database_populator.py | 17 +++++++++++++++-- nfoguard-web/static/index.html | 6 +++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index caf6c23..00e9aca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.10.0-skipped-tracking-fix2 +2.10.0-skipped-tracking-fix3 diff --git a/core/database_populator.py b/core/database_populator.py index f44d034..2bac515 100644 --- a/core/database_populator.py +++ b/core/database_populator.py @@ -5,6 +5,7 @@ Bulk populates the NFOGuard database from Radarr/Sonarr Phase 4: Replace NFO-based initial population with direct DB/API queries """ import time +import hashlib from typing import Dict, List, Optional, Tuple from datetime import datetime from pathlib import Path @@ -82,16 +83,28 @@ class DatabasePopulator: _log("DEBUG", f"Extracted IMDb ID {imdb_id} from path for: {movie.get('title')}") if not imdb_id: + # Generate placeholder IMDb ID using hash of path + path_hash = hashlib.md5(path.encode()).hexdigest()[:12] + imdb_id = f"missing-{path_hash}" skip_reason = 'No IMDb ID found' skip_info = { 'title': movie.get('title', 'Unknown'), 'year': movie.get('year'), + 'imdb_id': imdb_id, 'path': path, 'reason': skip_reason } stats['skipped_items'].append(skip_info) - _log("DEBUG", f"Skipping movie without IMDb ID: {movie.get('title')} (path: {path})") - # Note: Cannot mark in DB because no IMDb ID (primary key) + _log("DEBUG", f"Movie without IMDb ID: {movie.get('title')} (path: {path}), using placeholder {imdb_id}") + + # Mark as skipped in database with placeholder IMDb ID + self.db.mark_movie_skipped( + imdb_id=imdb_id, + title=movie.get('title', 'Unknown'), + year=movie.get('year', 0), + path=path, + reason=skip_reason + ) stats['skipped'] += 1 continue diff --git a/nfoguard-web/static/index.html b/nfoguard-web/static/index.html index 252aee3..b9d626a 100644 --- a/nfoguard-web/static/index.html +++ b/nfoguard-web/static/index.html @@ -4,7 +4,7 @@ NFOGuard - Database Management - + @@ -12,7 +12,7 @@
-

NFOGuard v2.10.0-skipped-tracking-fix2

+

NFOGuard v2.10.0-skipped-tracking-fix3

Database Management & Reporting