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");