Add ability to play and delete exports from webUI (#7882)

* add ability to playback exports on exports screen

* Add ability to delete exports from exports screen

* Fix large dialog

* Formatting
This commit is contained in:
Nicolas Mowen
2023-09-21 04:20:57 -06:00
committed by GitHub
parent 9a1c8b2cc4
commit e5664826b1
3 changed files with 137 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ from frigate.const import (
CACHE_DIR,
CLIPS_DIR,
CONFIG_DIR,
EXPORT_DIR,
MAX_SEGMENT_DURATION,
RECORD_DIR,
)
@@ -1666,6 +1667,20 @@ def export_recording(camera_name: str, start_time, end_time):
return "Starting export of recording", 200
@bp.route("/export/<file_name>", methods=["DELETE"])
def export_delete(file_name: str):
file = os.path.join(EXPORT_DIR, file_name)
if not os.path.exists(file):
return make_response(
jsonify({"success": False, "message": f"{file_name} not found."}),
404,
)
os.unlink(file)
return "Successfully deleted file", 200
def imagestream(detected_frames_processor, camera_name, fps, height, draw_options):
while True:
# max out at specified FPS