From 24e2f8423119bbbc62d206b9a156b369b6e243e3 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sun, 21 Nov 2021 07:25:01 -0600 Subject: [PATCH] ensure duration > 0 for segments --- frigate/http.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frigate/http.py b/frigate/http.py index 69c06c41d..eda33c4ca 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -658,8 +658,12 @@ def vod_ts(camera, start_ts, end_ts): # Determine if we need to end the last clip early if recording.end_time > end_ts: duration -= int((recording.end_time - end_ts) * 1000) - clips.append(clip) - durations.append(duration) + + if duration > 0: + clips.append(clip) + durations.append(duration) + else: + logger.warning(f"Recording clip is missing or empty: {recording.path}") if not clips: return "No recordings found.", 404