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.