From 9c57d6f410611ca8e82cd8ee764e5ea7d04ac962 Mon Sep 17 00:00:00 2001 From: yannick_meschner Date: Wed, 27 May 2026 12:27:16 +0200 Subject: [PATCH] Created a api point to get the video_file_data --- main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/main.py b/main.py index b06fdf6..d2954d3 100644 --- a/main.py +++ b/main.py @@ -375,6 +375,23 @@ def gen_frames(): @app.get("/video_feed") async def video_feed(): return StreamingResponse(gen_frames(), media_type="multipart/x-mixed-replace; boundary=frame") + +@app.get("/recordings") +async def getRecordings(): + cursor.execute("SELECT * FROM recordings") + sensor_data = cursor.fetchall() + + formated_data = [] + + for row in sensor_data: + formated_data.append({ + "id": row[0], + "timestamp": row[1], + "file_path": row[2], + }) + + return formated_data + # ------------------------------------------------------------- # @entrypoint # @description Starts the FastAPI app server using Uvicorn.