mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
filter review items and motion to be main camera in recordings view only (#10403)
This commit is contained in:
parent
8c0275fe2f
commit
dce2e9b366
@ -53,6 +53,11 @@ export function DesktopRecordingView({
|
|||||||
|
|
||||||
const [playbackStart, setPlaybackStart] = useState(startTime);
|
const [playbackStart, setPlaybackStart] = useState(startTime);
|
||||||
|
|
||||||
|
const mainCameraReviewItems = useMemo(
|
||||||
|
() => reviewItems.filter((cam) => cam.camera == mainCamera),
|
||||||
|
[reviewItems, mainCamera],
|
||||||
|
);
|
||||||
|
|
||||||
// timeline time
|
// timeline time
|
||||||
|
|
||||||
const timeRange = useMemo(() => getChunkedTimeDay(startTime), [startTime]);
|
const timeRange = useMemo(() => getChunkedTimeDay(startTime), [startTime]);
|
||||||
@ -139,6 +144,7 @@ export function DesktopRecordingView({
|
|||||||
before: timeRange.end,
|
before: timeRange.end,
|
||||||
after: timeRange.start,
|
after: timeRange.start,
|
||||||
scale: SEGMENT_DURATION / 2,
|
scale: SEGMENT_DURATION / 2,
|
||||||
|
cameras: mainCamera,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: null,
|
: null,
|
||||||
@ -229,7 +235,7 @@ export function DesktopRecordingView({
|
|||||||
showHandlebar
|
showHandlebar
|
||||||
handlebarTime={currentTime}
|
handlebarTime={currentTime}
|
||||||
setHandlebarTime={setCurrentTime}
|
setHandlebarTime={setCurrentTime}
|
||||||
events={reviewItems}
|
events={mainCameraReviewItems}
|
||||||
severityType={severity}
|
severityType={severity}
|
||||||
contentRef={contentRef}
|
contentRef={contentRef}
|
||||||
onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)}
|
onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)}
|
||||||
@ -243,7 +249,7 @@ export function DesktopRecordingView({
|
|||||||
showHandlebar
|
showHandlebar
|
||||||
handlebarTime={currentTime}
|
handlebarTime={currentTime}
|
||||||
setHandlebarTime={setCurrentTime}
|
setHandlebarTime={setCurrentTime}
|
||||||
events={reviewItems}
|
events={mainCameraReviewItems}
|
||||||
motion_events={motionData ?? []}
|
motion_events={motionData ?? []}
|
||||||
severityType={severity}
|
severityType={severity}
|
||||||
contentRef={contentRef}
|
contentRef={contentRef}
|
||||||
@ -295,6 +301,11 @@ export function MobileRecordingView({
|
|||||||
[selectedRangeIdx, timeRange],
|
[selectedRangeIdx, timeRange],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const mainCameraReviewItems = useMemo(
|
||||||
|
() => reviewItems.filter((cam) => cam.camera == playbackCamera),
|
||||||
|
[reviewItems, playbackCamera],
|
||||||
|
);
|
||||||
|
|
||||||
// move to next clip
|
// move to next clip
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!controllerRef.current) {
|
if (!controllerRef.current) {
|
||||||
@ -356,6 +367,7 @@ export function MobileRecordingView({
|
|||||||
before: timeRange.end,
|
before: timeRange.end,
|
||||||
after: timeRange.start,
|
after: timeRange.start,
|
||||||
scale: SEGMENT_DURATION / 2,
|
scale: SEGMENT_DURATION / 2,
|
||||||
|
cameras: playbackCamera,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: null,
|
: null,
|
||||||
@ -424,7 +436,7 @@ export function MobileRecordingView({
|
|||||||
showHandlebar
|
showHandlebar
|
||||||
handlebarTime={currentTime}
|
handlebarTime={currentTime}
|
||||||
setHandlebarTime={setCurrentTime}
|
setHandlebarTime={setCurrentTime}
|
||||||
events={reviewItems}
|
events={mainCameraReviewItems}
|
||||||
severityType={severity}
|
severityType={severity}
|
||||||
contentRef={contentRef}
|
contentRef={contentRef}
|
||||||
onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)}
|
onHandlebarDraggingChange={(scrubbing) => setScrubbing(scrubbing)}
|
||||||
@ -438,7 +450,7 @@ export function MobileRecordingView({
|
|||||||
showHandlebar
|
showHandlebar
|
||||||
handlebarTime={currentTime}
|
handlebarTime={currentTime}
|
||||||
setHandlebarTime={setCurrentTime}
|
setHandlebarTime={setCurrentTime}
|
||||||
events={reviewItems}
|
events={mainCameraReviewItems}
|
||||||
motion_events={motionData ?? []}
|
motion_events={motionData ?? []}
|
||||||
severityType={severity}
|
severityType={severity}
|
||||||
contentRef={contentRef}
|
contentRef={contentRef}
|
||||||
|
Loading…
Reference in New Issue
Block a user