mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
Handle sub labels
This commit is contained in:
parent
8952e97952
commit
ccd9826325
@ -3,7 +3,7 @@ import {
|
|||||||
useInitialCameraState,
|
useInitialCameraState,
|
||||||
useMotionActivity,
|
useMotionActivity,
|
||||||
} from "@/api/ws";
|
} from "@/api/ws";
|
||||||
import { CameraConfig } from "@/types/frigateConfig";
|
import { ATTRIBUTE_LABELS, CameraConfig } from "@/types/frigateConfig";
|
||||||
import { MotionData, ReviewSegment } from "@/types/review";
|
import { MotionData, ReviewSegment } from "@/types/review";
|
||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { useTimelineUtils } from "./use-timeline-utils";
|
import { useTimelineUtils } from "./use-timeline-utils";
|
||||||
@ -77,8 +77,20 @@ export function useCameraActivity(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const newObjects = [...objects];
|
const newObjects = [...objects];
|
||||||
newObjects[updatedEventIndex].label =
|
|
||||||
updatedEvent.after.sub_label ?? updatedEvent.after.label;
|
let label = updatedEvent.after.label;
|
||||||
|
|
||||||
|
if (updatedEvent.after.sub_label) {
|
||||||
|
const sub_label = updatedEvent.after.sub_label[0];
|
||||||
|
|
||||||
|
if (ATTRIBUTE_LABELS.includes(sub_label)) {
|
||||||
|
label = sub_label;
|
||||||
|
} else {
|
||||||
|
label = `${label}-verified`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
newObjects[updatedEventIndex].label = label;
|
||||||
newObjects[updatedEventIndex].stationary =
|
newObjects[updatedEventIndex].stationary =
|
||||||
updatedEvent.after.stationary;
|
updatedEvent.after.stationary;
|
||||||
setObjects(newObjects);
|
setObjects(newObjects);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user