From 9755fa05376c7f183bcad60563d3b77dd0a2d57a Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Sun, 3 Nov 2024 14:00:12 -0300 Subject: [PATCH] Fix exports migration when there is none (#14761) --- frigate/util/config.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/frigate/util/config.py b/frigate/util/config.py index a9a9666d9..3f3c45aa6 100644 --- a/frigate/util/config.py +++ b/frigate/util/config.py @@ -50,14 +50,15 @@ def migrate_frigate_config(config_file: str): previous_version = "0.14" logger.info("Migrating export file names...") - for file in os.listdir(EXPORT_DIR): - if "@" not in file: - continue + if os.path.isdir(EXPORT_DIR): + for file in os.listdir(EXPORT_DIR): + if "@" not in file: + continue - new_name = file.replace("@", "_") - os.rename( - os.path.join(EXPORT_DIR, file), os.path.join(EXPORT_DIR, new_name) - ) + new_name = file.replace("@", "_") + os.rename( + os.path.join(EXPORT_DIR, file), os.path.join(EXPORT_DIR, new_name) + ) if previous_version < "0.15-0": logger.info(f"Migrating frigate config from {previous_version} to 0.15-0...")