mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-02 01:16:32 +02:00
Fix fetching of generated preview video (#13498)
This commit is contained in:
parent
5239790835
commit
21a50cc452
@ -127,6 +127,7 @@ export function AnimatedEventCard({
|
|||||||
<TooltipContent>Mark as Reviewed</TooltipContent>
|
<TooltipContent>Mark as Reviewed</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
|
{previews != undefined && (
|
||||||
<div
|
<div
|
||||||
className="size-full cursor-pointer overflow-hidden rounded md:rounded-lg"
|
className="size-full cursor-pointer overflow-hidden rounded md:rounded-lg"
|
||||||
onClick={onOpenReview}
|
onClick={onOpenReview}
|
||||||
@ -140,7 +141,7 @@ export function AnimatedEventCard({
|
|||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{previews ? (
|
{previews.length ? (
|
||||||
<VideoPreview
|
<VideoPreview
|
||||||
relevantPreview={previews[previews.length - 1]}
|
relevantPreview={previews[previews.length - 1]}
|
||||||
startTime={event.start_time}
|
startTime={event.start_time}
|
||||||
@ -180,6 +181,7 @@ export function AnimatedEventCard({
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
{isLoaded && (
|
{isLoaded && (
|
||||||
<div className="absolute inset-x-0 bottom-0 h-6 rounded bg-gradient-to-t from-slate-900/50 to-transparent">
|
<div className="absolute inset-x-0 bottom-0 h-6 rounded bg-gradient-to-t from-slate-900/50 to-transparent">
|
||||||
<div className="absolute bottom-0 left-1 w-full text-xs text-white">
|
<div className="absolute bottom-0 left-1 w-full text-xs text-white">
|
||||||
|
@ -29,7 +29,7 @@ export function useCameraPreviews(
|
|||||||
{ revalidateOnFocus: autoRefresh, revalidateOnReconnect: autoRefresh },
|
{ revalidateOnFocus: autoRefresh, revalidateOnReconnect: autoRefresh },
|
||||||
);
|
);
|
||||||
|
|
||||||
return allPreviews;
|
return fetchPreviews ? allPreviews : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need to add a buffer of 5 seconds to the end preview times
|
// we need to add a buffer of 5 seconds to the end preview times
|
||||||
|
Loading…
Reference in New Issue
Block a user