Backend and webui fixes (#11309)

* Ensure that items without end times are set to not have a snapshot

* Save full frame if no frame is currently saved

* Webui fixes

* Cleanup
This commit is contained in:
Nicolas Mowen
2024-05-09 07:20:33 -06:00
committed by GitHub
parent 4bcbf7435a
commit 4216d08099
4 changed files with 39 additions and 5 deletions

View File

@@ -204,8 +204,8 @@ export default function DynamicVideoPlayer({
/>
<PreviewPlayer
className={cn(
isScrubbing || isLoading ? "visible" : "hidden",
className,
isScrubbing || isLoading ? "visible" : "hidden",
)}
camera={camera}
timeRange={timeRange}

View File

@@ -25,7 +25,7 @@ export function useCameraPreviews(
const { data: allPreviews } = useSWR<Preview[]>(
fetchPreviews
? `preview/${camera}/start/${timeRange.after}/end/${timeRange.before}`
? `preview/${camera}/start/${Math.round(timeRange.after)}/end/${Math.round(timeRange.before)}`
: null,
{ revalidateOnFocus: false, revalidateOnReconnect: false },
);