From a8c888b1f01ac4773a1ca0942df75176ee261869 Mon Sep 17 00:00:00 2001 From: mrlt8 <67088095+mrlt8@users.noreply.github.com> Date: Mon, 26 Aug 2024 00:32:16 -0700 Subject: [PATCH] purge old snapshots when taking any snapshot --- app/wyzebridge/ffmpeg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/wyzebridge/ffmpeg.py b/app/wyzebridge/ffmpeg.py index f8873192..c12b706b 100644 --- a/app/wyzebridge/ffmpeg.py +++ b/app/wyzebridge/ffmpeg.py @@ -225,7 +225,8 @@ def rtsp_snap_cmd(cam_name: str, interval: bool = False): img = f"{base}.{ext}".format(cam_name=cam_name, CAM_NAME=cam_name.upper()) os.makedirs(os.path.dirname(img), exist_ok=True) - keep_time = parse_timedelta("SNAPSHOT_KEEP") + keep_time = parse_timedelta("SNAPSHOT_KEEP") + if keep_time and SNAPSHOT_FORMAT: purge_old(IMG_PATH, ext, keep_time) rotation = []