Skip to content

Commit

Permalink
Use pre capture for custom events (#7038)
Browse files Browse the repository at this point in the history
* Use pre capture for custom events

* Formatting
  • Loading branch information
NickM-27 committed Jul 6, 2023
1 parent 998bffe commit 0f68fbc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frigate/events/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ def create_manual_event(
"label": label,
"sub_label": sub_label,
"camera": camera,
"start_time": now,
"end_time": now + duration if duration is not None else None,
"start_time": now - camera_config.record.events.pre_capture,
"end_time": now
+ duration
+ camera_config.record.events.post_capture
if duration is not None
else None,
"thumbnail": thumbnail,
"has_clip": camera_config.record.enabled and include_recording,
"has_snapshot": True,
Expand Down

0 comments on commit 0f68fbc

Please sign in to comment.