mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-11 17:47:37 +03:00
fixes
This commit is contained in:
parent
160e7b15a0
commit
a627a79f47
@ -120,16 +120,16 @@ export function MotionSegment({
|
|||||||
return showMinimap && segmentTime === alignedMinimapEndTime;
|
return showMinimap && segmentTime === alignedMinimapEndTime;
|
||||||
}, [showMinimap, segmentTime, alignedMinimapEndTime]);
|
}, [showMinimap, segmentTime, alignedMinimapEndTime]);
|
||||||
|
|
||||||
// Top border: current segment has no recording, but previous segment has recordings
|
// Bottom border: current segment HAS recording, but next segment (below/earlier) has NO recording
|
||||||
const isFirstSegmentWithoutRecording = useMemo(() => {
|
const isFirstSegmentWithoutRecording = useMemo(() => {
|
||||||
return hasRecording === false && prevIsNoRecording === false;
|
return hasRecording === true && nextIsNoRecording === true;
|
||||||
}, [hasRecording, prevIsNoRecording]);
|
|
||||||
|
|
||||||
// Bottom border: current segment has no recording, but next segment has recordings
|
|
||||||
const isLastSegmentWithoutRecording = useMemo(() => {
|
|
||||||
return hasRecording === false && nextIsNoRecording === false;
|
|
||||||
}, [hasRecording, nextIsNoRecording]);
|
}, [hasRecording, nextIsNoRecording]);
|
||||||
|
|
||||||
|
// Top border: current segment HAS recording, but prev segment (above/later) has NO recording
|
||||||
|
const isLastSegmentWithoutRecording = useMemo(() => {
|
||||||
|
return hasRecording === true && prevIsNoRecording === true;
|
||||||
|
}, [hasRecording, prevIsNoRecording]);
|
||||||
|
|
||||||
const firstMinimapSegmentRef = useRef<HTMLDivElement>(null);
|
const firstMinimapSegmentRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -198,10 +198,10 @@ export function MotionSegment({
|
|||||||
onTouchEnd={(event) => handleTouchStart(event, segmentClick)}
|
onTouchEnd={(event) => handleTouchStart(event, segmentClick)}
|
||||||
>
|
>
|
||||||
{isFirstSegmentWithoutRecording && (
|
{isFirstSegmentWithoutRecording && (
|
||||||
<div className="absolute -top-[1px] left-0 right-0 h-[1px] bg-primary-variant/50" />
|
<div className="absolute bottom-[0px] left-0 right-0 h-[1px] bg-primary-variant/50" />
|
||||||
)}
|
)}
|
||||||
{isLastSegmentWithoutRecording && (
|
{isLastSegmentWithoutRecording && (
|
||||||
<div className="absolute bottom-[0px] left-0 right-0 h-[1px] bg-primary-variant/50" />
|
<div className="absolute -top-[1px] left-0 right-0 h-[1px] bg-primary-variant/50" />
|
||||||
)}
|
)}
|
||||||
{!motionOnly && (
|
{!motionOnly && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@ -158,12 +158,17 @@ export const VirtualizedMotionSegments = forwardRef<
|
|||||||
|
|
||||||
const hasRecording = getRecordingAvailability(segmentTime);
|
const hasRecording = getRecordingAvailability(segmentTime);
|
||||||
|
|
||||||
|
// Check if previous and next segments have recordings
|
||||||
|
// This is important because in motionOnly mode, the segments array is filtered
|
||||||
const prevSegmentTime = segmentTime + segmentDuration;
|
const prevSegmentTime = segmentTime + segmentDuration;
|
||||||
const nextSegmentTime = segmentTime - segmentDuration;
|
const nextSegmentTime = segmentTime - segmentDuration;
|
||||||
|
|
||||||
const prevHasRecording = getRecordingAvailability(prevSegmentTime);
|
const prevHasRecording = getRecordingAvailability(prevSegmentTime);
|
||||||
const nextHasRecording = getRecordingAvailability(nextSegmentTime);
|
const nextHasRecording = getRecordingAvailability(nextSegmentTime);
|
||||||
|
|
||||||
|
// Check if prev/next segments have no recording available
|
||||||
|
// Note: We only check hasRecording, not motion values, because segments can have
|
||||||
|
// recordings available but no motion (eg, start of a recording before motion begins)
|
||||||
const prevIsNoRecording = prevHasRecording === false;
|
const prevIsNoRecording = prevHasRecording === false;
|
||||||
const nextIsNoRecording = nextHasRecording === false;
|
const nextIsNoRecording = nextHasRecording === false;
|
||||||
|
|
||||||
|
|||||||
@ -924,7 +924,7 @@ function Timeline({
|
|||||||
{
|
{
|
||||||
before: timeRange.before,
|
before: timeRange.before,
|
||||||
after: timeRange.after,
|
after: timeRange.after,
|
||||||
scale: Math.round(zoomSettings.segmentDuration / 2),
|
scale: Math.round(zoomSettings.segmentDuration),
|
||||||
cameras: mainCamera,
|
cameras: mainCamera,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user