Improve review segmentation behavior (#19850)

* Refactor active objects to class

* Keep segment going when detection is newer than end of alert

* Cleanup logic

* Fix

* Cleanup ending

* Adjust timing

* Improve detection saving

* Don't have padding at end for in progress reviews

* Add review config for cutoff times
This commit is contained in:
Nicolas Mowen
2025-08-31 16:36:12 -05:00
committed by GitHub
parent a478c38f8a
commit 3a1e1d0841
4 changed files with 242 additions and 145 deletions
@@ -315,9 +315,9 @@ export function InProgressPreview({
const apiHost = useApiHost();
const sliderRef = useRef<HTMLDivElement | null>(null);
const { data: previewFrames } = useSWR<string[]>(
`preview/${camera}/start/${Math.floor(startTime) - PREVIEW_PADDING}/end/${
Math.ceil(endTime ?? timeRange.before) + PREVIEW_PADDING
}/frames`,
`preview/${camera}/start/${Math.floor(startTime) - PREVIEW_PADDING}/end/${Math.ceil(
endTime ?? timeRange.before,
)}/frames`,
{ revalidateOnFocus: false },
);