From dce2e9b366c285b1a09e18da8a73e8af4344220f Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 12 Mar 2024 12:08:31 -0500 Subject: [PATCH] filter review items and motion to be main camera in recordings view only (#10403) --- web/src/views/events/RecordingView.tsx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/web/src/views/events/RecordingView.tsx b/web/src/views/events/RecordingView.tsx index f95d99ec6..bbc564a46 100644 --- a/web/src/views/events/RecordingView.tsx +++ b/web/src/views/events/RecordingView.tsx @@ -53,6 +53,11 @@ export function DesktopRecordingView({ const [playbackStart, setPlaybackStart] = useState(startTime); + const mainCameraReviewItems = useMemo( + () => reviewItems.filter((cam) => cam.camera == mainCamera), + [reviewItems, mainCamera], + ); + // timeline time const timeRange = useMemo(() => getChunkedTimeDay(startTime), [startTime]); @@ -139,6 +144,7 @@ export function DesktopRecordingView({ before: timeRange.end, after: timeRange.start, scale: SEGMENT_DURATION / 2, + cameras: mainCamera, }, ] : null, @@ -229,7 +235,7 @@ export function DesktopRecordingView({ showHandlebar handlebarTime={currentTime} setHandlebarTime={setCurrentTime} - events={reviewItems} + events={mainCameraReviewItems} severityType={severity} contentRef={contentRef} onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)} @@ -243,7 +249,7 @@ export function DesktopRecordingView({ showHandlebar handlebarTime={currentTime} setHandlebarTime={setCurrentTime} - events={reviewItems} + events={mainCameraReviewItems} motion_events={motionData ?? []} severityType={severity} contentRef={contentRef} @@ -295,6 +301,11 @@ export function MobileRecordingView({ [selectedRangeIdx, timeRange], ); + const mainCameraReviewItems = useMemo( + () => reviewItems.filter((cam) => cam.camera == playbackCamera), + [reviewItems, playbackCamera], + ); + // move to next clip useEffect(() => { if (!controllerRef.current) { @@ -356,6 +367,7 @@ export function MobileRecordingView({ before: timeRange.end, after: timeRange.start, scale: SEGMENT_DURATION / 2, + cameras: playbackCamera, }, ] : null, @@ -424,7 +436,7 @@ export function MobileRecordingView({ showHandlebar handlebarTime={currentTime} setHandlebarTime={setCurrentTime} - events={reviewItems} + events={mainCameraReviewItems} severityType={severity} contentRef={contentRef} onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)} @@ -438,7 +450,7 @@ export function MobileRecordingView({ showHandlebar handlebarTime={currentTime} setHandlebarTime={setCurrentTime} - events={reviewItems} + events={mainCameraReviewItems} motion_events={motionData ?? []} severityType={severity} contentRef={contentRef}