web: switch to aiohttp
Local Docker Build (Dev) / build-dev (push) Successful in 5s

This commit is contained in:
2025-10-26 12:32:57 -04:00
parent 254c9c9c5f
commit f38ca539d6
+11 -9
View File
@@ -1545,16 +1545,17 @@ async def get_episodes_missing_nfo_dateadded(dependencies: dict):
print("🔧 Calling core container for NFO repair scan...")
# Call the core container's NFO repair scan endpoint
import httpx
import aiohttp
import asyncio
core_url = f"http://nfoguard-core:{config.core_api_port}/admin/nfo-repair-scan"
print(f"🔍 DEBUG: Calling core container at: {core_url}")
async with httpx.AsyncClient(timeout=300.0) as client: # 5 minute timeout for filesystem scan
response = await client.get(core_url)
if response.status_code == 200:
result = response.json()
timeout = aiohttp.ClientTimeout(total=300.0) # 5 minute timeout for filesystem scan
async with aiohttp.ClientSession(timeout=timeout) as session:
async with session.get(core_url) as response:
if response.status == 200:
result = await response.json()
print(f"✅ Core container scan complete: {result['total_missing']} items missing dateadded")
# Transform the data to match the expected legacy format
@@ -1605,11 +1606,12 @@ async def get_episodes_missing_nfo_dateadded(dependencies: dict):
}
}
else:
print(f"❌ Core container scan failed: {response.status_code} - {response.text}")
error_text = await response.text()
print(f"❌ Core container scan failed: {response.status} - {error_text}")
return {
"success": False,
"error": f"Core container scan failed: {response.status_code}",
"message": f"Failed to check NFO files via core container: {response.status_code}"
"error": f"Core container scan failed: {response.status}",
"message": f"Failed to check NFO files via core container: {response.status}"
}
except Exception as e: