Accept floats for export when used directly with event start / end time (#7314)

* Accept floats for export when used directly with event start / end time

* Formatting

* Formatting
This commit is contained in:
Nicolas Mowen 2023-07-29 06:05:17 -06:00 committed by GitHub
parent eaf7078d98
commit 947ccbc654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1603,8 +1603,14 @@ def vod_event(id):
)
@bp.route("/export/<camera_name>/start/<start_time>/end/<end_time>", methods=["POST"])
def export_recording(camera_name: str, start_time: int, end_time: int):
@bp.route(
"/export/<camera_name>/start/<int:start_time>/end/<int:end_time>", methods=["POST"]
)
@bp.route(
"/export/<camera_name>/start/<float:start_time>/end/<float:end_time>",
methods=["POST"],
)
def export_recording(camera_name: str, start_time, end_time):
playback_factor = request.get_json(silent=True).get("playback", "realtime")
exporter = RecordingExporter(
current_app.frigate_config,