From 2bc8736fd901b3bb8b2bc9d727d34a5149781c09 Mon Sep 17 00:00:00 2001 From: kluszczyn Date: Tue, 22 Dec 2020 01:17:25 +0100 Subject: [PATCH] Recordings - fix expire_file --- frigate/record.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/record.py b/frigate/record.py index a6be58bdc..334f9408f 100644 --- a/frigate/record.py +++ b/frigate/record.py @@ -98,9 +98,9 @@ class RecordingMaintainer(threading.Thread): delete_before[name] = datetime.datetime.now().timestamp() - SECONDS_IN_DAY*camera.record.retain_days for p in Path('/media/frigate/recordings').rglob("*.mp4"): - if not p.parent in delete_before: + if not p.parent.name in delete_before: continue - if p.stat().st_mtime < delete_before[p.parent]: + if p.stat().st_mtime < delete_before[p.parent.name]: p.unlink(missing_ok=True) def run(self): @@ -122,4 +122,4 @@ class RecordingMaintainer(threading.Thread): self.move_files() - \ No newline at end of file +