From c487d0aa93479f5ccdb8d607ea7908ee43b788c3 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 17 Nov 2025 12:39:48 -0700 Subject: [PATCH] Catch case where user requsts clip for time that has no recordings --- frigate/api/media.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frigate/api/media.py b/frigate/api/media.py index 2bad3658f..a8eb71ce1 100644 --- a/frigate/api/media.py +++ b/frigate/api/media.py @@ -762,6 +762,15 @@ async def recording_clip( .order_by(Recordings.start_time.asc()) ) + if recordings.count() == 0: + return JSONResponse( + content={ + "success": False, + "message": "No recordings found for the specified time range", + }, + status_code=400, + ) + file_name = sanitize_filename(f"playlist_{camera_name}_{start_ts}-{end_ts}.txt") file_path = os.path.join(CACHE_DIR, file_name) with open(file_path, "w") as file: