Skip to content

Commit

Permalink
Correctly update segment data (#11922)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Jun 12, 2024
1 parent 187d98a commit 3e1861e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frigate/review/maintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,9 @@ def update_segment(
camera_config: CameraConfig,
frame,
objects: list[TrackedObject],
prev_data: dict[str, any],
) -> None:
"""Update segment."""
prev_data = segment.get_data(ended=False)

if frame is not None:
segment.update_frame(camera_config, frame, objects)

Expand Down Expand Up @@ -240,6 +239,7 @@ def update_existing_segment(
"""Validate if existing review segment should continue."""
camera_config = self.config.cameras[segment.camera]
active_objects = get_active_objects(frame_time, camera_config, objects)
prev_data = segment.get_data(False)

if len(active_objects) > 0:
should_update = False
Expand Down Expand Up @@ -288,7 +288,7 @@ def update_existing_segment(
frame_id, camera_config.frame_shape_yuv
)
self.update_segment(
segment, camera_config, yuv_frame, active_objects
segment, camera_config, yuv_frame, active_objects, prev_data
)
self.frame_manager.close(frame_id)
except FileNotFoundError:
Expand All @@ -302,7 +302,7 @@ def update_existing_segment(
)
segment.save_full_frame(camera_config, yuv_frame)
self.frame_manager.close(frame_id)
self.update_segment(segment, camera_config, None, [])
self.update_segment(segment, camera_config, None, [], prev_data)
except FileNotFoundError:
return

Expand Down

0 comments on commit 3e1861e

Please sign in to comment.