mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix export timing (#12080)
This commit is contained in:
parent
a60ffe06ac
commit
c871bebee6
@ -1,7 +1,7 @@
|
|||||||
import { baseUrl } from "@/api/baseUrl";
|
import { baseUrl } from "@/api/baseUrl";
|
||||||
import { useFormattedTimestamp } from "@/hooks/use-date-utils";
|
import { useFormattedTimestamp } from "@/hooks/use-date-utils";
|
||||||
import { FrigateConfig } from "@/types/frigateConfig";
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
import { ReviewSegment } from "@/types/review";
|
import { REVIEW_PADDING, ReviewSegment } from "@/types/review";
|
||||||
import { getIconForLabel } from "@/utils/iconUtil";
|
import { getIconForLabel } from "@/utils/iconUtil";
|
||||||
import { isDesktop, isIOS, isSafari } from "react-device-detect";
|
import { isDesktop, isIOS, isSafari } from "react-device-detect";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
@ -54,9 +54,13 @@ export default function ReviewCard({
|
|||||||
}, [event]);
|
}, [event]);
|
||||||
|
|
||||||
const onExport = useCallback(async () => {
|
const onExport = useCallback(async () => {
|
||||||
|
const endTime = event.end_time
|
||||||
|
? event.end_time + REVIEW_PADDING
|
||||||
|
: Date.now() / 1000;
|
||||||
|
|
||||||
axios
|
axios
|
||||||
.post(
|
.post(
|
||||||
`export/${event.camera}/start/${event.start_time}/end/${event.end_time}`,
|
`export/${event.camera}/start/${event.start_time + REVIEW_PADDING}/end/${endTime}`,
|
||||||
{ playback: "realtime" },
|
{ playback: "realtime" },
|
||||||
)
|
)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user