mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-06-13 01:16:53 +02:00
expire overlapping segments based on mode
This commit is contained in:
parent
18fd50dfce
commit
b19a02888a
@ -448,8 +448,19 @@ class RecordingCleanup(threading.Thread):
|
|||||||
if event.end_time < recording.start_time:
|
if event.end_time < recording.start_time:
|
||||||
event_start = idx
|
event_start = idx
|
||||||
|
|
||||||
# Delete recordings outside of the retention window
|
# Delete recordings outside of the retention window or based on the retention mode
|
||||||
if not keep:
|
if (
|
||||||
|
not keep
|
||||||
|
or (
|
||||||
|
config.record.events.retain.mode == RetainModeEnum.motion
|
||||||
|
and recording.motion == 0
|
||||||
|
)
|
||||||
|
or (
|
||||||
|
config.record.events.retain.mode
|
||||||
|
== RetainModeEnum.active_objects
|
||||||
|
and recording.objects == 0
|
||||||
|
)
|
||||||
|
):
|
||||||
Path(recording.path).unlink(missing_ok=True)
|
Path(recording.path).unlink(missing_ok=True)
|
||||||
deleted_recordings.add(recording.id)
|
deleted_recordings.add(recording.id)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user