fix mypy (#22889)
Some checks are pending
CI / ARM Extra Build (push) Blocked by required conditions
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions

This commit is contained in:
Nicolas Mowen 2026-04-15 09:02:41 -06:00 committed by GitHub
parent 3e85b18ee3
commit d830d47c9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -372,7 +372,7 @@ class RecordingMaintainer(threading.Thread):
) )
record_config = self.config.cameras[camera].record record_config = self.config.cameras[camera].record
segment_info: SegmentInfo | None = None segment_stats: SegmentInfo | None = None
highest = None highest = None
if record_config.continuous.days > 0: if record_config.continuous.days > 0:
@ -402,18 +402,18 @@ class RecordingMaintainer(threading.Thread):
if highest == "continuous" if highest == "continuous"
else RetainModeEnum.motion else RetainModeEnum.motion
) )
segment_info = self.segment_stats(camera, start_time, end_time) segment_stats = self.segment_stats(camera, start_time, end_time)
# Here we only check if we should move the segment based on non-object recording retention # Here we only check if we should move the segment based on non-object recording retention
# we will always want to check for overlapping review items below before dropping the segment # we will always want to check for overlapping review items below before dropping the segment
if not segment_info.should_discard_segment(record_mode): if not segment_stats.should_discard_segment(record_mode):
return await self.move_segment( return await self.move_segment(
camera, camera,
start_time, start_time,
end_time, end_time,
duration, duration,
cache_path, cache_path,
segment_info, segment_stats,
) )
# we fell through the continuous / motion check, so we need to check the review items # we fell through the continuous / motion check, so we need to check the review items
@ -447,10 +447,10 @@ class RecordingMaintainer(threading.Thread):
else record_config.detections.retain.mode else record_config.detections.retain.mode
) )
if segment_info is None: if segment_stats is None:
segment_info = self.segment_stats(camera, start_time, end_time) segment_stats = self.segment_stats(camera, start_time, end_time)
if not segment_info.should_discard_segment(record_mode): if not segment_stats.should_discard_segment(record_mode):
# move from cache to recordings immediately # move from cache to recordings immediately
return await self.move_segment( return await self.move_segment(
camera, camera,
@ -458,7 +458,7 @@ class RecordingMaintainer(threading.Thread):
end_time, end_time,
duration, duration,
cache_path, cache_path,
segment_info, segment_stats,
) )
else: else:
self.drop_segment(cache_path) self.drop_segment(cache_path)