This commit is contained in:
@@ -1258,9 +1258,12 @@ def register_web_routes(app, dependencies):
|
||||
return {"status": "logged_out", "message": "Session cleared"}
|
||||
|
||||
# Database population endpoints
|
||||
print("🔧 DEBUG: Registering /admin/populate-database endpoint...")
|
||||
|
||||
@app.post("/admin/populate-database")
|
||||
async def api_populate_database(request: Request, background_tasks: BackgroundTasks):
|
||||
"""Populate database from Radarr/Sonarr"""
|
||||
print(f"🔥 DEBUG: populate-database endpoint called!")
|
||||
try:
|
||||
data = await request.json()
|
||||
media_type = data.get("media_type", "both")
|
||||
@@ -1269,6 +1272,8 @@ def register_web_routes(app, dependencies):
|
||||
media_type = request.query_params.get("media_type", "both")
|
||||
return await populate_database(background_tasks, media_type, dependencies)
|
||||
|
||||
print("✅ DEBUG: /admin/populate-database registered")
|
||||
|
||||
@app.get("/api/populate/status")
|
||||
async def api_populate_status():
|
||||
"""Get database population status"""
|
||||
@@ -1280,4 +1285,8 @@ def register_web_routes(app, dependencies):
|
||||
"""Health check endpoint for container monitoring"""
|
||||
return {"status": "healthy", "service": "nfoguard-web"}
|
||||
|
||||
print("✅ Web routes registered successfully")
|
||||
print("✅ Web routes registered successfully")
|
||||
print(f"📋 DEBUG: Registered routes count: {len(app.routes)}")
|
||||
for route in app.routes:
|
||||
if hasattr(route, 'path') and hasattr(route, 'methods'):
|
||||
print(f" - {route.methods} {route.path}")
|
||||
Reference in New Issue
Block a user