web: manual update debug
Local Docker Build (Dev) / build-dev (push) Successful in 5s

This commit is contained in:
2025-10-26 11:32:59 -04:00
parent cb46b56243
commit 1d837102e9
2 changed files with 97 additions and 4 deletions
+40 -4
View File
@@ -597,10 +597,46 @@ async def update_episode_date(dependencies: dict, imdb_id: str, season: int, epi
has_video_file=episode_data.get('has_video_file', False)
)
# Note: NFO file updates are handled by the core container
# The web container only updates the database
print(f"✅ Database updated for {imdb_id} S{season:02d}E{episode:02d}")
print(f"️ NFO file updates will be handled by the core container on next scan")
# Trigger NFO file update via core container
try:
import urllib.request
import urllib.parse
import json
import os
# Get core container connection details
core_host = os.environ.get("CORE_API_HOST", "nfoguard-core")
core_port = os.environ.get("CORE_API_PORT", "8080")
# Call core container to update NFO file
nfo_update_url = f"http://{core_host}:{core_port}/api/episodes/{imdb_id}/{season}/{episode}/update-nfo"
# Create request data
request_data = {
"dateadded": dateadded,
"source": source,
"aired": episode_data.get('aired').isoformat() if episode_data.get('aired') else None
}
# Make POST request to core container
req = urllib.request.Request(
nfo_update_url,
data=json.dumps(request_data).encode('utf-8'),
headers={'Content-Type': 'application/json'},
method='POST'
)
with urllib.request.urlopen(req, timeout=10) as response:
if response.status == 200:
print(f"✅ Database and NFO file updated for {imdb_id} S{season:02d}E{episode:02d}")
else:
print(f"✅ Database updated for {imdb_id} S{season:02d}E{episode:02d}")
print(f"⚠️ NFO file update failed (HTTP {response.status})")
except Exception as e:
print(f"✅ Database updated for {imdb_id} S{season:02d}E{episode:02d}")
print(f"⚠️ NFO file update failed: {e}")
print(f"️ NFO will be updated on next scan")
# Add to processing history
db.add_processing_history(