Add selected dashcam imports

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-09 18:34:52 -04:00
co-authored by Copilot
parent e058ea8a41
commit c57457b934
6 changed files with 194 additions and 15 deletions
+16 -2
View File
@@ -35,8 +35,22 @@ def dash_devices():
@app.route('/api/dash/import', methods=['POST'])
def dash_import():
summary = app_dash.import_dashcam()
return jsonify(summary)
body = request.get_json(silent=True)
if body is None:
relative_paths = None
elif isinstance(body, dict):
relative_paths = body.get("paths", [])
else:
relative_paths = []
summary = app_dash.import_dashcam(relative_paths=relative_paths)
status_code = (
200
if summary["status"] == "ok"
else 400
if summary["status"] == "invalid_selection"
else 409
)
return jsonify(summary), status_code
@app.route('/api/dash/files')
def dash_files():