From 63a61f288d7887ba35c713dc7e97afda27da590e Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Sun, 5 Nov 2023 06:44:15 -0700 Subject: [PATCH] Fix periodic sync --- frigate/record/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/record/util.py b/frigate/record/util.py index 4710b063e..685d26856 100644 --- a/frigate/record/util.py +++ b/frigate/record/util.py @@ -108,15 +108,15 @@ def sync_recordings(limited: bool) -> None: if limited: # get recording files from last 36 hours - hour_check = ( + hour_check = f"{RECORD_DIR}/{( datetime.datetime.now().astimezone(datetime.timezone.utc) - datetime.timedelta(hours=36) - ).strftime("%Y-%m-%d/%H") + ).strftime('%Y-%m-%d/%H')}" files_on_disk = { os.path.join(root, file) for root, _, files in os.walk(RECORD_DIR) for file in files - if file > hour_check + if root > hour_check } else: # get all recordings files on disk and put them in a set