update: to reading IMDB's
Local Docker Build (Dev) / build-dev (push) Successful in 5s

This commit is contained in:
2025-11-03 14:14:42 -05:00
parent 73967da3e6
commit 01887f082a
4 changed files with 18 additions and 8 deletions
+1 -1
View File
@@ -1 +1 @@
2.8.6-sql-fix 2.8.7-imdb-path-extraction
+14 -4
View File
@@ -7,11 +7,13 @@ Phase 4: Replace NFO-based initial population with direct DB/API queries
import time import time
from typing import Dict, List, Optional, Tuple from typing import Dict, List, Optional, Tuple
from datetime import datetime from datetime import datetime
from pathlib import Path
from core.database import NFOGuardDatabase from core.database import NFOGuardDatabase
from clients.radarr_client import RadarrClient from clients.radarr_client import RadarrClient
from clients.sonarr_client import SonarrClient from clients.sonarr_client import SonarrClient
from utils.logging import _log from utils.logging import _log
from utils.imdb_utils import parse_imdb_from_path
class DatabasePopulator: class DatabasePopulator:
@@ -66,9 +68,20 @@ class DatabasePopulator:
# Process each movie # Process each movie
for movie in movies: for movie in movies:
try: try:
# Get movie path first (we'll need it for IMDb extraction)
path = movie.get('path', '')
# Try to get IMDb ID from Radarr database
imdb_id = movie.get('imdbId') imdb_id = movie.get('imdbId')
# If not in database, try extracting from directory/filename
if not imdb_id and path:
imdb_id = parse_imdb_from_path(Path(path))
if imdb_id:
_log("DEBUG", f"Extracted IMDb ID {imdb_id} from path for: {movie.get('title')}")
if not imdb_id: if not imdb_id:
_log("DEBUG", f"Skipping movie without IMDb ID: {movie.get('title')}") _log("DEBUG", f"Skipping movie without IMDb ID: {movie.get('title')} (path: {path})")
stats['skipped'] += 1 stats['skipped'] += 1
continue continue
@@ -79,9 +92,6 @@ class DatabasePopulator:
stats['skipped'] += 1 stats['skipped'] += 1
continue continue
# Get movie path
path = movie.get('path', '')
# Get release date # Get release date
released = None released = None
if movie.get('digitalRelease'): if movie.get('digitalRelease'):
+1 -1
View File
@@ -33,7 +33,7 @@ def create_web_app() -> FastAPI:
app = FastAPI( app = FastAPI(
title="NFOGuard Web Interface", title="NFOGuard Web Interface",
description="Web interface for NFOGuard media database management", description="Web interface for NFOGuard media database management",
version="2.8.6-sql-fix", version="2.8.7-imdb-path-extraction",
docs_url="/docs" if web_config.web_debug else None, docs_url="/docs" if web_config.web_debug else None,
redoc_url="/redoc" if web_config.web_debug else None redoc_url="/redoc" if web_config.web_debug else None
) )
+2 -2
View File
@@ -29,7 +29,7 @@ def create_web_app() -> FastAPI:
app = FastAPI( app = FastAPI(
title="NFOGuard Web Interface", title="NFOGuard Web Interface",
description="Web interface for NFOGuard media database management", description="Web interface for NFOGuard media database management",
version="2.8.6-sql-fix", version="2.8.7-imdb-path-extraction",
docs_url=None, # Disable docs in production docs_url=None, # Disable docs in production
redoc_url=None redoc_url=None
) )
@@ -94,7 +94,7 @@ def setup_static_files(app: FastAPI) -> None:
"status": "healthy", "status": "healthy",
"service": "nfoguard-web", "service": "nfoguard-web",
"timestamp": time.time(), "timestamp": time.time(),
"version": "2.8.6-sql-fix" "version": "2.8.7-imdb-path-extraction"
} }
except Exception as e: except Exception as e:
from fastapi import HTTPException from fastapi import HTTPException