This commit is contained in:
+29
-7
@@ -1219,7 +1219,11 @@ async def get_episode_date_options(dependencies: dict, imdb_id: str, season: int
|
||||
def register_web_routes(app, dependencies):
|
||||
"""Register all web API routes with FastAPI app"""
|
||||
|
||||
# Dashboard and stats endpoints
|
||||
# Dashboard and stats endpoints
|
||||
@app.get("/api/dashboard")
|
||||
async def api_dashboard():
|
||||
return await get_dashboard_stats(dependencies)
|
||||
|
||||
@app.get("/api/dashboard/stats")
|
||||
async def api_dashboard_stats():
|
||||
return await get_dashboard_stats(dependencies)
|
||||
@@ -1232,11 +1236,15 @@ def register_web_routes(app, dependencies):
|
||||
|
||||
@app.post("/api/movies/{imdb_id}/update-date")
|
||||
async def api_update_movie_date(imdb_id: str, dateadded: str = None, source: str = "manual"):
|
||||
return await update_movie_date(dependencies, imdb_id, dateadded, source)
|
||||
return {"error": "Updates not available in web container. Use core container on port 8085."}
|
||||
|
||||
@app.put("/api/movies/{imdb_id}")
|
||||
async def api_update_movie(imdb_id: str, dateadded: str = None, source: str = "manual"):
|
||||
return {"error": "Updates not available in web container. Use core container on port 8085."}
|
||||
|
||||
@app.get("/api/movies/{imdb_id}/date-options")
|
||||
async def api_movie_date_options(imdb_id: str):
|
||||
return await get_movie_date_options(dependencies, imdb_id)
|
||||
return {"options": [], "message": "Date options not available in web container. Use core container on port 8085."}
|
||||
|
||||
# TV series endpoints
|
||||
@app.get("/api/series")
|
||||
@@ -1260,18 +1268,32 @@ def register_web_routes(app, dependencies):
|
||||
@app.post("/api/episodes/{imdb_id}/{season}/{episode}/update-date")
|
||||
async def api_update_episode_date(imdb_id: str, season: int, episode: int,
|
||||
dateadded: str = None, source: str = "manual"):
|
||||
return await update_episode_date(dependencies, imdb_id, season, episode, dateadded, source)
|
||||
return {"error": "Updates not available in web container. Use core container on port 8085."}
|
||||
|
||||
@app.put("/api/episodes/{imdb_id}/{season}/{episode}")
|
||||
async def api_update_episode(imdb_id: str, season: int, episode: int,
|
||||
dateadded: str = None, source: str = "manual"):
|
||||
return {"error": "Updates not available in web container. Use core container on port 8085."}
|
||||
|
||||
@app.get("/api/episodes/{imdb_id}/{season}/{episode}/date-options")
|
||||
async def api_episode_date_options(imdb_id: str, season: int, episode: int):
|
||||
return await get_episode_date_options(dependencies, imdb_id, season, episode)
|
||||
return {"options": [], "message": "Date options not available in web container. Use core container on port 8085."}
|
||||
|
||||
# Bulk operations
|
||||
@app.post("/api/bulk/update-source")
|
||||
async def api_bulk_update_source(media_type: str, old_source: str, new_source: str):
|
||||
return await bulk_update_source(dependencies, media_type, old_source, new_source)
|
||||
return {"error": "Bulk operations not available in web container. Use core container on port 8085."}
|
||||
|
||||
# Reports
|
||||
@app.get("/api/reports/missing-dates")
|
||||
async def api_missing_dates_report():
|
||||
return await get_missing_dates_report(dependencies)
|
||||
return await get_missing_dates_report(dependencies)
|
||||
|
||||
# Authentication endpoints (for web interface compatibility)
|
||||
@app.get("/api/auth/status")
|
||||
async def api_auth_status():
|
||||
return {"authenticated": False, "username": None} # Simplified for now
|
||||
|
||||
@app.post("/api/auth/logout")
|
||||
async def api_auth_logout():
|
||||
return {"status": "success", "message": "Logged out"}
|
||||
Reference in New Issue
Block a user