updates: debugs for 35 without date
Local Docker Build (Dev) / build-dev (push) Successful in 5s

This commit is contained in:
2025-10-26 13:29:03 -04:00
parent 14ae2a205c
commit 9c8da4d63b
+28 -1
View File
@@ -2303,7 +2303,7 @@ def register_routes(app, dependencies: dict):
# Scan episodes
print("📺 Scanning episodes for missing dateadded elements")
episode_query = """
SELECT DISTINCT e.imdb_id, e.season, e.episode, s.path as series_path, e.dateadded, e.has_video_file
SELECT DISTINCT e.imdb_id, e.season, e.episode, s.path as series_path, e.dateadded, e.has_video_file, e.source
FROM episodes e
JOIN series s ON e.imdb_id = s.imdb_id
WHERE e.has_video_file = TRUE
@@ -2338,6 +2338,19 @@ def register_routes(app, dependencies: dict):
# Build NFO path using series path
series_name = os.path.basename(episode["series_path"])
# Debug specific episodes we know should be missing
if "Hudson" in series_name and episode['season'] == 8 and episode['episode'] == 5:
print(f"🔍 DEBUG: Processing Hudson & Rex S08E05")
print(f" Series path: {episode['series_path']}")
print(f" DB dateadded: {episode['dateadded']}")
print(f" DB source: {episode.get('source', 'unknown')}")
if "Star Trek" in series_name and episode['season'] == 3 and episode['episode'] == 7:
print(f"🔍 DEBUG: Processing Star Trek SNW S03E07")
print(f" Series path: {episode['series_path']}")
print(f" DB dateadded: {episode['dateadded']}")
print(f" DB source: {episode.get('source', 'unknown')}")
# Try multiple NFO file naming patterns that might exist
season_dir = os.path.join(episode["series_path"], f"Season {episode['season']:02d}")
@@ -2370,6 +2383,12 @@ def register_routes(app, dependencies: dict):
# Skip if no NFO file found (already checked above)
if not nfo_path:
# Debug specific episodes
if "Hudson" in series_name and episode['season'] == 8 and episode['episode'] == 5:
print(f"🔍 DEBUG: Hudson & Rex S08E05 - NFO file not found at expected paths")
print(f" Series path: {episode['series_path']}")
print(f" Season dir: {season_dir}")
print(f" DB source: {episode.get('source', 'unknown')}")
continue
# Check if NFO file has dateadded element
@@ -2380,6 +2399,13 @@ def register_routes(app, dependencies: dict):
# NFO file is missing dateadded element
if dateadded_elem is None or not dateadded_elem.text or not dateadded_elem.text.strip():
# Special logging for database sync issues
db_source = episode.get("source", "unknown")
if db_source == "Nfo_File_Existing":
print(f"🔍 DATABASE SYNC ISSUE: {series_name} S{episode['season']:02d}E{episode['episode']:02d} - DB says 'Nfo_File_Existing' but NFO missing dateadded")
print(f" NFO Path: {nfo_path}")
print(f" DB dateadded: {episode['dateadded']}")
missing_items["episodes"].append({
"imdb_id": episode["imdb_id"],
"season": episode["season"],
@@ -2388,6 +2414,7 @@ def register_routes(app, dependencies: dict):
"series_path": episode["series_path"],
"dateadded": episode["dateadded"],
"nfo_path": nfo_path,
"db_source": db_source,
"reason": "NFO missing dateadded element"
})
except ET.ParseError as e: