From 413779ee2a9b7e8f50ecf4241e0ed848324ca8ba Mon Sep 17 00:00:00 2001 From: ryzendigo <48058157+ryzendigo@users.noreply.github.com> Date: Mon, 16 Mar 2026 14:40:40 +0800 Subject: [PATCH] fix: operator precedence bug in detection type check The condition: topic == DetectionTypeEnum.api.value or DetectionTypeEnum.lpr.value evaluates as: (topic == DetectionTypeEnum.api.value) or (DetectionTypeEnum.lpr.value) Since DetectionTypeEnum.lpr.value is a non-empty string (truthy), the second operand is always True regardless of topic. The intended check is whether topic matches either enum value: topic == DetectionTypeEnum.api.value or topic == DetectionTypeEnum.lpr.value --- frigate/record/maintainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/record/maintainer.py b/frigate/record/maintainer.py index 68040476a..26b64b2d3 100644 --- a/frigate/record/maintainer.py +++ b/frigate/record/maintainer.py @@ -727,7 +727,7 @@ class RecordingMaintainer(threading.Thread): ) ) elif ( - topic == DetectionTypeEnum.api.value or DetectionTypeEnum.lpr.value + topic == DetectionTypeEnum.api.value or topic == DetectionTypeEnum.lpr.value ): continue