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
This commit is contained in:
Josh Hawkins 2026-04-30 08:47:33 -05:00
parent ea0f4b6a0f
commit 2967aa1436
3 changed files with 5 additions and 11 deletions

View File

@ -15,7 +15,7 @@ TRIGGER_DIR = f"{CLIPS_DIR}/triggers"
BIRDSEYE_PIPE = "/tmp/cache/birdseye" BIRDSEYE_PIPE = "/tmp/cache/birdseye"
CACHE_DIR = "/tmp/cache" CACHE_DIR = "/tmp/cache"
REPLAY_CAMERA_PREFIX = "_replay_" 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_ENV_VAR = "PLUS_API_KEY"
PLUS_API_HOST = "https://api.frigate.video" PLUS_API_HOST = "https://api.frigate.video"

View File

@ -391,10 +391,8 @@ export default function MobileReviewSettingsDrawer({
className="flex w-full items-center justify-center gap-2" className="flex w-full items-center justify-center gap-2"
aria-label={t("title", { ns: "views/replay" })} aria-label={t("title", { ns: "views/replay" })}
onClick={() => { onClick={() => {
const now = new Date(latestTime * 1000);
now.setHours(now.getHours() - 1);
setDebugReplayRange({ setDebugReplayRange({
after: now.getTime() / 1000, after: latestTime - 60,
before: latestTime, before: latestTime,
}); });
setSelectedReplayOption("1"); setSelectedReplayOption("1");
@ -541,11 +539,9 @@ export default function MobileReviewSettingsDrawer({
return; return;
} }
const hours = parseInt(option); const minutes = parseInt(option, 10);
const end = latestTime; const end = latestTime;
const now = new Date(end * 1000); setDebugReplayRange({ after: end - minutes * 60, before: end });
now.setHours(now.getHours() - hours);
setDebugReplayRange({ after: now.getTime() / 1000, before: end });
}; };
content = ( content = (

View File

@ -728,10 +728,8 @@ export function RecordingView({
setShareTimestampOpen(true); setShareTimestampOpen(true);
}} }}
onDebugReplayClick={() => { onDebugReplayClick={() => {
const now = new Date(timeRange.before * 1000);
now.setHours(now.getHours() - 1);
setDebugReplayRange({ setDebugReplayRange({
after: now.getTime() / 1000, after: timeRange.before - 60,
before: timeRange.before, before: timeRange.before,
}); });
setDebugReplayMode("select"); setDebugReplayMode("select");