From ccbe2fda9a2b074a725b4b4cb07ccc833798525d Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 3 May 2026 12:25:27 -0500 Subject: [PATCH] fix --- frigate/api/debug_replay.py | 10 +++++----- frigate/jobs/debug_replay.py | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/frigate/api/debug_replay.py b/frigate/api/debug_replay.py index 0ceb16e13..171bf1b98 100644 --- a/frigate/api/debug_replay.py +++ b/frigate/api/debug_replay.py @@ -84,20 +84,20 @@ async def start_debug_replay(request: Request, body: DebugReplayStartBody): config_publisher=request.app.config_publisher, replay_manager=replay_manager, ) - except RuntimeError as exc: + except RuntimeError: return JSONResponse( content={ "success": False, - "message": str(exc), + "message": "A replay session is already active", }, status_code=409, ) - except ValueError as exc: - logger.info("Rejected debug replay start request: %s", exc) + except ValueError: + logger.exception("Rejected debug replay start request") return JSONResponse( content={ "success": False, - "message": str(exc), + "message": "Invalid debug replay parameters", }, status_code=400, ) diff --git a/frigate/jobs/debug_replay.py b/frigate/jobs/debug_replay.py index b2859bc0d..0616c4629 100644 --- a/frigate/jobs/debug_replay.py +++ b/frigate/jobs/debug_replay.py @@ -13,7 +13,7 @@ import subprocess as sp import threading import time from dataclasses import dataclass -from typing import TYPE_CHECKING, Any, Optional +from typing import TYPE_CHECKING, Any, Optional, cast from peewee import ModelSelect @@ -97,7 +97,7 @@ def query_recordings(source_camera: str, start_ts: float, end_ts: float) -> Mode Module-level so tests can patch it without instantiating a runner. """ - return ( + query = ( Recordings.select( Recordings.path, Recordings.start_time, @@ -111,6 +111,7 @@ def query_recordings(source_camera: str, start_ts: float, end_ts: float) -> Mode .where(Recordings.camera == source_camera) .order_by(Recordings.start_time.asc()) ) + return cast(ModelSelect, query) class DebugReplayJobRunner(threading.Thread):