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
from typing import Dict, List, Optional, Tuple
from datetime import datetime
from pathlib import Path
from core.database import NFOGuardDatabase
from clients.radarr_client import RadarrClient
from clients.sonarr_client import SonarrClient
from utils.logging import _log
from utils.imdb_utils import parse_imdb_from_path
class DatabasePopulator:
@@ -66,9 +68,20 @@ class DatabasePopulator:
# Process each movie
for movie in movies:
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')
# 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:
_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
continue
@@ -79,9 +92,6 @@ class DatabasePopulator:
stats['skipped'] += 1
continue
# Get movie path
path = movie.get('path', '')
# Get release date
released = None
if movie.get('digitalRelease'):
+1 -1
View File
@@ -33,7 +33,7 @@ def create_web_app() -> FastAPI:
app = FastAPI(
title="NFOGuard Web Interface",
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,
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(
title="NFOGuard Web Interface",
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
redoc_url=None
)
@@ -94,7 +94,7 @@ def setup_static_files(app: FastAPI) -> None:
"status": "healthy",
"service": "nfoguard-web",
"timestamp": time.time(),
"version": "2.8.6-sql-fix"
"version": "2.8.7-imdb-path-extraction"
}
except Exception as e:
from fastapi import HTTPException