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):