From a8b90834b0dcbb7f96014d247007688d30f0828d Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 6 Jan 2026 10:13:32 -0600 Subject: [PATCH] use same logging pattern in sync_recordings as the other sync functions --- frigate/util/media.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/frigate/util/media.py b/frigate/util/media.py index a31b93e91..130fec79d 100644 --- a/frigate/util/media.py +++ b/frigate/util/media.py @@ -198,16 +198,20 @@ def sync_recordings( result.aborted = True return result - if files_to_delete and not dry_run: + if dry_run: logger.info( - f"Deleting {len(files_to_delete)} recordings files with missing DB entries" + f"Recordings sync (dry run): Found {len(files_to_delete)} orphaned files" ) - for file in files_to_delete: - try: - os.unlink(file) - result.orphans_deleted += 1 - except OSError as e: - logger.error(f"Failed to delete {file}: {e}") + return result + + # Delete orphans + logger.info(f"Deleting {len(files_to_delete)} orphaned recordings files") + for file in files_to_delete: + try: + os.unlink(file) + result.orphans_deleted += 1 + except OSError as e: + logger.error(f"Failed to delete {file}: {e}") logger.debug("End sync recordings.")