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}")
|
||||
@@ -33,7 +33,7 @@ def create_web_app() -> FastAPI:
|
||||
app = FastAPI(
|
||||
title="NFOGuard Web Interface",
|
||||
description="Web interface for NFOGuard media database management",
|
||||
version="2.6.12-web",
|
||||
version="2.8.1-populate-fix",
|
||||
docs_url="/docs" if web_config.web_debug else None,
|
||||
redoc_url="/redoc" if web_config.web_debug else None
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>NFOGuard - Database Management</title>
|
||||
<link rel="stylesheet" href="/static/css/styles.css?v=manual-scan-ui">
|
||||
<link rel="stylesheet" href="/static/css/styles.css?v=2.8.1-populate-fix">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
@@ -12,7 +12,7 @@
|
||||
<!-- Header -->
|
||||
<header class="app-header">
|
||||
<div class="header-content">
|
||||
<h1><i class="fas fa-shield-alt"></i> NFOGuard</h1>
|
||||
<h1><i class="fas fa-shield-alt"></i> NFOGuard <span style="font-size: 0.5em; color: #888;">v2.8.1-populate-fix</span></h1>
|
||||
<p>Database Management & Reporting</p>
|
||||
</div>
|
||||
<div class="auth-status" id="auth-status" style="display: none;">
|
||||
@@ -711,6 +711,6 @@
|
||||
<!-- Toast Notifications -->
|
||||
<div class="toast-container" id="toast-container"></div>
|
||||
|
||||
<script src="/static/js/app.js?v=scheduled-scans-system"></script>
|
||||
<script src="/static/js/app.js?v=2.8.1-populate-fix"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user