Fix exports migration when there is none (#14761)

This commit is contained in:
Felipe Santos 2024-11-03 14:00:12 -03:00 committed by GitHub
parent 77ec86d31a
commit 9755fa0537
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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...")