Skip to content

Commit

Permalink
ensure cache copies when events have ended
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Nov 21, 2021
1 parent 77c1f1b commit c1155af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frigate/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def move_files(self):
.where(
Event.camera == camera,
(Event.end_time == None)
| (Event.end_time >= recordings[0]["start_time"]),
| (Event.end_time >= recordings[0]["start_time"].timestamp()),
Event.has_clip,
)
.order_by(Event.start_time)
Expand Down Expand Up @@ -171,7 +171,10 @@ def move_files(self):

# if the event is in progress or ends after the recording starts, keep it
# and stop looking at events
if event.end_time is None or event.end_time >= start_time:
if (
event.end_time is None
or event.end_time >= start_time.timestamp()
):
overlaps = True
break

Expand Down

0 comments on commit c1155af

Please sign in to comment.