forked from Github/frigate
Motion timeline data (#10245)
* Refactor activity api to send motion and audio data * Prepare for using motion data timeline * Get working * reduce to 0 * fix * Formatting * fix typing * add motion data to timelines and allow motion cameas to be selectable * Fix tests * cleanup * Fix not loading preview when changing hours
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { MockMotionData } from "@/pages/UIPlayground";
|
||||
import { MotionData } from "@/types/review";
|
||||
|
||||
export const useMotionSegmentUtils = (
|
||||
segmentDuration: number,
|
||||
motion_events: MockMotionData[],
|
||||
motion_events: MotionData[],
|
||||
) => {
|
||||
const halfSegmentDuration = useMemo(
|
||||
() => segmentDuration / 2,
|
||||
@@ -47,7 +47,7 @@ export const useMotionSegmentUtils = (
|
||||
);
|
||||
});
|
||||
|
||||
return matchingEvent?.motionValue ?? 0;
|
||||
return matchingEvent?.motion ?? 0;
|
||||
},
|
||||
[motion_events, getSegmentStart, getSegmentEnd],
|
||||
);
|
||||
@@ -61,7 +61,7 @@ export const useMotionSegmentUtils = (
|
||||
);
|
||||
});
|
||||
|
||||
return matchingEvent?.audioValue ?? 0;
|
||||
return matchingEvent?.audio ?? 0;
|
||||
},
|
||||
[motion_events, getSegmentStart, getSegmentEnd],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user