This commit is contained in:
@@ -1247,6 +1247,31 @@ def register_web_routes(app, dependencies):
|
||||
async def api_movie_date_options(imdb_id: str):
|
||||
return {"options": [], "message": "Date options not available in web container. Use core container on port 8085."}
|
||||
|
||||
@app.delete("/api/movies/{imdb_id}")
|
||||
async def api_delete_movie(imdb_id: str):
|
||||
"""Delete a movie from the database"""
|
||||
db = dependencies["db"]
|
||||
|
||||
try:
|
||||
# Use the existing database method
|
||||
deleted = db.delete_movie(imdb_id)
|
||||
|
||||
if deleted:
|
||||
return {
|
||||
"success": True,
|
||||
"status": "success",
|
||||
"message": f"Deleted movie {imdb_id}",
|
||||
"imdb_id": imdb_id
|
||||
}
|
||||
else:
|
||||
raise HTTPException(status_code=404, detail="Movie not found")
|
||||
|
||||
except HTTPException:
|
||||
raise # Re-raise HTTP exceptions
|
||||
except Exception as e:
|
||||
print(f"❌ Error deleting movie: {e}")
|
||||
raise HTTPException(status_code=500, detail=f"Failed to delete movie: {str(e)}")
|
||||
|
||||
# TV series endpoints
|
||||
@app.get("/api/series")
|
||||
async def api_series_list(skip: int = 0, limit: int = 50, search: str = None,
|
||||
|
||||
Reference in New Issue
Block a user