This commit is contained in:
@@ -1258,9 +1258,12 @@ def register_web_routes(app, dependencies):
|
|||||||
return {"status": "logged_out", "message": "Session cleared"}
|
return {"status": "logged_out", "message": "Session cleared"}
|
||||||
|
|
||||||
# Database population endpoints
|
# Database population endpoints
|
||||||
|
print("🔧 DEBUG: Registering /admin/populate-database endpoint...")
|
||||||
|
|
||||||
@app.post("/admin/populate-database")
|
@app.post("/admin/populate-database")
|
||||||
async def api_populate_database(request: Request, background_tasks: BackgroundTasks):
|
async def api_populate_database(request: Request, background_tasks: BackgroundTasks):
|
||||||
"""Populate database from Radarr/Sonarr"""
|
"""Populate database from Radarr/Sonarr"""
|
||||||
|
print(f"🔥 DEBUG: populate-database endpoint called!")
|
||||||
try:
|
try:
|
||||||
data = await request.json()
|
data = await request.json()
|
||||||
media_type = data.get("media_type", "both")
|
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")
|
media_type = request.query_params.get("media_type", "both")
|
||||||
return await populate_database(background_tasks, media_type, dependencies)
|
return await populate_database(background_tasks, media_type, dependencies)
|
||||||
|
|
||||||
|
print("✅ DEBUG: /admin/populate-database registered")
|
||||||
|
|
||||||
@app.get("/api/populate/status")
|
@app.get("/api/populate/status")
|
||||||
async def api_populate_status():
|
async def api_populate_status():
|
||||||
"""Get database population status"""
|
"""Get database population status"""
|
||||||
@@ -1281,3 +1286,7 @@ def register_web_routes(app, dependencies):
|
|||||||
return {"status": "healthy", "service": "nfoguard-web"}
|
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(
|
app = FastAPI(
|
||||||
title="NFOGuard Web Interface",
|
title="NFOGuard Web Interface",
|
||||||
description="Web interface for NFOGuard media database management",
|
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,
|
docs_url="/docs" if web_config.web_debug else None,
|
||||||
redoc_url="/redoc" 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 charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>NFOGuard - Database Management</title>
|
<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">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<header class="app-header">
|
<header class="app-header">
|
||||||
<div class="header-content">
|
<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>
|
<p>Database Management & Reporting</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="auth-status" id="auth-status" style="display: none;">
|
<div class="auth-status" id="auth-status" style="display: none;">
|
||||||
@@ -711,6 +711,6 @@
|
|||||||
<!-- Toast Notifications -->
|
<!-- Toast Notifications -->
|
||||||
<div class="toast-container" id="toast-container"></div>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user