empty assumption for events

This commit is contained in:
Josh Hawkins 2023-10-25 19:42:13 -05:00 committed by Nicolas Mowen
parent 139664e598
commit 52b47a3414

View File

@ -256,9 +256,10 @@ class RecordingMaintainer(threading.Thread):
# if it ends more than the configured pre_capture for the camera # if it ends more than the configured pre_capture for the camera
else: else:
pre_capture = self.config.cameras[camera].record.events.pre_capture pre_capture = self.config.cameras[camera].record.events.pre_capture
most_recently_processed_frame_time = self.object_recordings_info[ camera_info = self.object_recordings_info[camera]
camera most_recently_processed_frame_time = (
][-1][0] camera_info[-1][0] if len(camera_info) > 0 else 0
)
retain_cutoff = most_recently_processed_frame_time - pre_capture retain_cutoff = most_recently_processed_frame_time - pre_capture
if end_time.timestamp() < retain_cutoff: if end_time.timestamp() < retain_cutoff:
Path(cache_path).unlink(missing_ok=True) Path(cache_path).unlink(missing_ok=True)