formatting

This commit is contained in:
Josh Hawkins
2026-05-03 12:07:29 -05:00
parent 393d4dd423
commit 23f18505f5
4 changed files with 19 additions and 11 deletions
+5
View File
@@ -59,6 +59,11 @@ class DebugReplayStopResponse(BaseModel):
@router.post(
"/debug_replay/start",
response_model=DebugReplayStartResponse,
status_code=202,
responses={
400: {"description": "Invalid camera, time range, or no recordings"},
409: {"description": "A replay session is already active"},
},
dependencies=[Depends(require_role(["admin"]))],
summary="Start debug replay",
description="Start a debug replay session from camera recordings. Returns "
+1 -3
View File
@@ -124,9 +124,7 @@ class DebugReplayManager:
try:
new_config = FrigateConfig.parse_object(config_data)
except Exception as e:
raise RuntimeError(
f"Failed to validate replay camera config: {e}"
) from e
raise RuntimeError(f"Failed to validate replay camera config: {e}") from e
frigate_config.cameras[replay_name] = new_config.cameras[replay_name]
config_publisher.publish_update(
+2 -6
View File
@@ -100,9 +100,7 @@ class TestDebugReplayManagerStop(unittest.TestCase):
with (
patch.object(manager, "_cleanup_db"),
patch.object(manager, "_cleanup_files"),
patch(
"frigate.debug_replay.cancel_debug_replay_job", return_value=False
),
patch("frigate.debug_replay.cancel_debug_replay_job", return_value=False),
):
manager.stop(frigate_config=frigate_config, config_publisher=publisher)
@@ -127,9 +125,7 @@ class TestDebugReplayManagerStop(unittest.TestCase):
with (
patch.object(manager, "_cleanup_db"),
patch.object(manager, "_cleanup_files"),
patch(
"frigate.debug_replay.cancel_debug_replay_job", return_value=True
),
patch("frigate.debug_replay.cancel_debug_replay_job", return_value=True),
):
manager.stop(frigate_config=frigate_config, config_publisher=publisher)
+11 -2
View File
@@ -1,6 +1,5 @@
"""Tests for the shared ffmpeg progress helper."""
import subprocess as sp
import unittest
from unittest.mock import MagicMock, patch
@@ -13,7 +12,17 @@ class TestInjectProgressFlags(unittest.TestCase):
result = inject_progress_flags(cmd)
self.assertEqual(
result,
["ffmpeg", "-i", "in.mp4", "-c", "copy", "-progress", "pipe:2", "-nostats", "out.mp4"],
[
"ffmpeg",
"-i",
"in.mp4",
"-c",
"copy",
"-progress",
"pipe:2",
"-nostats",
"out.mp4",
],
)
def test_empty_cmd_returns_empty(self):