don't show audio labels if audio is not enabled

This commit is contained in:
Josh Hawkins 2026-03-27 09:18:14 -05:00
parent 22827fd3c4
commit 15cbd2d75f

View File

@ -20,11 +20,16 @@ function getReviewLabels(context: FormContext): string[] {
trackLabels.forEach((label: string) => labels.add(label));
}
// Audio labels from listen config (camera-level, falling back to global)
const audioLabels =
fullCameraConfig?.audio?.listen ?? fullConfig?.audio?.listen;
if (Array.isArray(audioLabels)) {
audioLabels.forEach((label: string) => labels.add(label));
// Audio labels from listen config, only if audio detection is enabled
const audioEnabled =
fullCameraConfig?.audio?.enabled_in_config ??
fullConfig?.audio?.enabled_in_config;
if (audioEnabled) {
const audioLabels =
fullCameraConfig?.audio?.listen ?? fullConfig?.audio?.listen;
if (Array.isArray(audioLabels)) {
audioLabels.forEach((label: string) => labels.add(label));
}
}
// Include any labels already in the review form data (alerts + detections)