From 73d7498246cff3b2c6439ff2179eb43e9744975c Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 17 Jun 2024 07:36:28 -0600 Subject: [PATCH 1/2] Don't fail when preview restore fails --- frigate/output/output.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/frigate/output/output.py b/frigate/output/output.py index d257f785c0..9ce6463790 100644 --- a/frigate/output/output.py +++ b/frigate/output/output.py @@ -174,10 +174,14 @@ def move_preview_frames(loc: str): preview_holdover = os.path.join(CLIPS_DIR, "preview_restart_cache") preview_cache = os.path.join(CACHE_DIR, "preview_frames") - if loc == "clips": - shutil.move(preview_cache, preview_holdover) - elif loc == "cache": - if not os.path.exists(preview_holdover): - return + try: + if loc == "clips": + shutil.move(preview_cache, preview_holdover) + elif loc == "cache": + if not os.path.exists(preview_holdover): + return - shutil.move(preview_holdover, preview_cache) + shutil.move(preview_holdover, preview_cache) + + except shutil.Error: + logger.error("Failed to restore preview cache.") From fadbac45eca7cf4e933f8e45f866d420f96019b4 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 17 Jun 2024 07:37:07 -0600 Subject: [PATCH 2/2] Cleanup --- frigate/output/output.py | 1 - 1 file changed, 1 deletion(-) diff --git a/frigate/output/output.py b/frigate/output/output.py index 9ce6463790..e458d3242e 100644 --- a/frigate/output/output.py +++ b/frigate/output/output.py @@ -182,6 +182,5 @@ def move_preview_frames(loc: str): return shutil.move(preview_holdover, preview_cache) - except shutil.Error: logger.error("Failed to restore preview cache.")