From 2967aa14365ca8f509eee1be5b314532683039a9 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 30 Apr 2026 08:47:33 -0500 Subject: [PATCH] debug replay fixes - initial selection without changing the radio button in the dialog would select 1 hour (rather than 1 minute) - use CLIPS_DIR instead of CACHE_DIR so that longer replay clips don't cause tmpfs cache overflows --- frigate/const.py | 2 +- .../components/overlay/MobileReviewSettingsDrawer.tsx | 10 +++------- web/src/views/recording/RecordingView.tsx | 4 +--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/frigate/const.py b/frigate/const.py index 51e06e4ad..07537ea5f 100644 --- a/frigate/const.py +++ b/frigate/const.py @@ -15,7 +15,7 @@ TRIGGER_DIR = f"{CLIPS_DIR}/triggers" BIRDSEYE_PIPE = "/tmp/cache/birdseye" CACHE_DIR = "/tmp/cache" REPLAY_CAMERA_PREFIX = "_replay_" -REPLAY_DIR = os.path.join(CACHE_DIR, "replay") +REPLAY_DIR = os.path.join(CLIPS_DIR, "replay") PLUS_ENV_VAR = "PLUS_API_KEY" PLUS_API_HOST = "https://api.frigate.video" diff --git a/web/src/components/overlay/MobileReviewSettingsDrawer.tsx b/web/src/components/overlay/MobileReviewSettingsDrawer.tsx index 63d391162..c409e5cfa 100644 --- a/web/src/components/overlay/MobileReviewSettingsDrawer.tsx +++ b/web/src/components/overlay/MobileReviewSettingsDrawer.tsx @@ -391,10 +391,8 @@ export default function MobileReviewSettingsDrawer({ className="flex w-full items-center justify-center gap-2" aria-label={t("title", { ns: "views/replay" })} onClick={() => { - const now = new Date(latestTime * 1000); - now.setHours(now.getHours() - 1); setDebugReplayRange({ - after: now.getTime() / 1000, + after: latestTime - 60, before: latestTime, }); setSelectedReplayOption("1"); @@ -541,11 +539,9 @@ export default function MobileReviewSettingsDrawer({ return; } - const hours = parseInt(option); + const minutes = parseInt(option, 10); const end = latestTime; - const now = new Date(end * 1000); - now.setHours(now.getHours() - hours); - setDebugReplayRange({ after: now.getTime() / 1000, before: end }); + setDebugReplayRange({ after: end - minutes * 60, before: end }); }; content = ( diff --git a/web/src/views/recording/RecordingView.tsx b/web/src/views/recording/RecordingView.tsx index 75b6519fc..d36ace40e 100644 --- a/web/src/views/recording/RecordingView.tsx +++ b/web/src/views/recording/RecordingView.tsx @@ -728,10 +728,8 @@ export function RecordingView({ setShareTimestampOpen(true); }} onDebugReplayClick={() => { - const now = new Date(timeRange.before * 1000); - now.setHours(now.getHours() - 1); setDebugReplayRange({ - after: now.getTime() / 1000, + after: timeRange.before - 60, before: timeRange.before, }); setDebugReplayMode("select");