diff --git a/backend/main.py b/backend/main.py index e9bb1ed8..d0745580 100644 --- a/backend/main.py +++ b/backend/main.py @@ -1,4 +1,3 @@ - import json import logging import os @@ -129,6 +128,8 @@ async def upload(req: Request, exercise: int): extension = ".mp4" if req.headers.get('content-type') == "video/quicktime": extension = ".mov" + else: + raise HTTPException(status_code=400, detail="Content type must be video/mp4 or video/quicktime") get_running_loop().run_in_executor(None, lambda: analyze(id, exercise, extension, video_bytes)) @@ -160,7 +161,6 @@ async def event_generator(): return result_video_file = result["video_file"] - print(result_video_file.name) videos[id] = result_video_file del result["video_file"] diff --git a/src/AppPage.tsx b/src/AppPage.tsx index 7e472a33..625d311b 100644 --- a/src/AppPage.tsx +++ b/src/AppPage.tsx @@ -207,7 +207,13 @@ export const AppPage = () => { sse.current.addEventListener('error', () => { notifications.show({ - message: 'Failed to open SSE connection.', + icon: ( + + ), + color: 'red', + title: 'Error', + autoClose: 10_000, + message: 'Error during SSE connection.', }); sse.current?.close(); sse.current = undefined;