movies: imdb lookup
Local Docker Build (Dev) / build-dev (push) Successful in 6s

This commit is contained in:
2025-11-03 14:22:58 -05:00
parent 01887f082a
commit 65896f1974
4 changed files with 27 additions and 16 deletions
+1 -1
View File
@@ -1 +1 @@
2.8.7-imdb-path-extraction 2.8.8-movie-id-tuple-fix
+20 -9
View File
@@ -94,23 +94,26 @@ class DatabasePopulator:
# Get release date # Get release date
released = None released = None
if movie.get('digitalRelease'): if movie.get('digital_release'):
released = movie.get('digitalRelease') released = movie.get('digital_release')
source_type = 'radarr:digital' source_type = 'radarr:digital'
elif movie.get('physicalRelease'): elif movie.get('physical_release'):
released = movie.get('physicalRelease') released = movie.get('physical_release')
source_type = 'radarr:physical' source_type = 'radarr:physical'
elif movie.get('inCinemas'): elif movie.get('in_cinemas'):
released = movie.get('inCinemas') released = movie.get('in_cinemas')
source_type = 'radarr:theatrical' source_type = 'radarr:theatrical'
else: else:
source_type = 'radarr:unknown' source_type = 'radarr:unknown'
# Get import date from Radarr history # Get import date from Radarr history using Radarr's internal movie ID
import_date = self.radarr.get_movie_import_date(imdb_id) radarr_movie_id = movie.get('id')
if radarr_movie_id:
# get_movie_import_date returns tuple (date, source)
import_date, import_source = self.radarr.get_movie_import_date(radarr_movie_id)
if import_date: if import_date:
dateadded = import_date dateadded = import_date
source = 'radarr:import_history' source = import_source
elif released: elif released:
# Use release date as fallback # Use release date as fallback
dateadded = released dateadded = released
@@ -119,6 +122,14 @@ class DatabasePopulator:
_log("DEBUG", f"No date available for movie {imdb_id}, skipping") _log("DEBUG", f"No date available for movie {imdb_id}, skipping")
stats['skipped'] += 1 stats['skipped'] += 1
continue continue
elif released:
# No Radarr ID, use release date
dateadded = released
source = f'{source_type}_fallback'
else:
_log("DEBUG", f"No date available for movie {imdb_id}, skipping")
stats['skipped'] += 1
continue
# Insert into database # Insert into database
self.db.upsert_movie_dates(imdb_id, released, dateadded, source, has_video_file=True) self.db.upsert_movie_dates(imdb_id, released, dateadded, source, has_video_file=True)
+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.7-imdb-path-extraction", version="2.8.8-movie-id-tuple-fix",
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.7-imdb-path-extraction", version="2.8.8-movie-id-tuple-fix",
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.7-imdb-path-extraction" "version": "2.8.8-movie-id-tuple-fix"
} }
except Exception as e: except Exception as e:
from fastapi import HTTPException from fastapi import HTTPException