From 139664e5987cf73774c3ee1c2ea13bc78d21a62f Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 25 Oct 2023 19:23:15 -0500 Subject: [PATCH] assumption on empty --- frigate/record/maintainer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frigate/record/maintainer.py b/frigate/record/maintainer.py index 7cc715afd..e0837b692 100644 --- a/frigate/record/maintainer.py +++ b/frigate/record/maintainer.py @@ -265,9 +265,11 @@ class RecordingMaintainer(threading.Thread): self.end_time_cache.pop(cache_path, None) # else retain days includes this segment else: - most_recently_processed_frame_time = self.object_recordings_info[camera][ - -1 - ][0] + # assume that empty means the relevant recording info has not been received yet + camera_info = self.object_recordings_info[camera] + most_recently_processed_frame_time = ( + camera_info[-1][0] if len(camera_info) > 0 else 0 + ) # ensure delayed segment info does not lead to lost segments if most_recently_processed_frame_time >= end_time.timestamp():