From a4920da07f14a8ac721c83c10b8fbbfa15164b89 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 4 Jan 2025 07:11:57 -0700 Subject: [PATCH] Add face dir creation --- frigate/app.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frigate/app.py b/frigate/app.py index 02955b6c9..6ac39ff1c 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -34,6 +34,7 @@ from frigate.const import ( CLIPS_DIR, CONFIG_DIR, EXPORT_DIR, + FACE_DIR, MODEL_CACHE_DIR, RECORD_DIR, SHM_FRAMES_VAR, @@ -96,14 +97,19 @@ class FrigateApp: self.config = config def ensure_dirs(self) -> None: - for d in [ + dirs = [ CONFIG_DIR, RECORD_DIR, f"{CLIPS_DIR}/cache", CACHE_DIR, MODEL_CACHE_DIR, EXPORT_DIR, - ]: + ] + + if self.config.face_recognition.enabled: + dirs.append(FACE_DIR) + + for d in dirs: if not os.path.exists(d) and not os.path.islink(d): logger.info(f"Creating directory: {d}") os.makedirs(d)