Don't timeshift recordings (#11449)

This commit is contained in:
Nicolas Mowen 2024-05-20 08:44:39 -06:00 committed by GitHub
parent 6e39d55dd3
commit 7413810fa4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,7 +12,6 @@ import ActivityIndicator from "@/components/indicators/activity-indicator";
import { VideoResolutionType } from "@/types/live"; import { VideoResolutionType } from "@/types/live";
import axios from "axios"; import axios from "axios";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { getTimestampOffset } from "@/utils/dateUtil";
/** /**
* Dynamically switches between video playback and scrubbing preview player. * Dynamically switches between video playback and scrubbing preview player.
@ -148,14 +147,13 @@ export default function DynamicVideoPlayer({
// state of playback player // state of playback player
const recordingParams = useMemo(() => { const recordingParams = useMemo(
const timeRangeOffset = getTimestampOffset(timeRange.before); () => ({
before: timeRange.before,
return { after: timeRange.after,
before: timeRange.before + timeRangeOffset, }),
after: timeRange.after + timeRangeOffset, [timeRange],
}; );
}, [timeRange]);
const { data: recordings } = useSWR<Recording[]>( const { data: recordings } = useSWR<Recording[]>(
[`${camera}/recordings`, recordingParams], [`${camera}/recordings`, recordingParams],
{ revalidateOnFocus: false }, { revalidateOnFocus: false },