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
This commit is contained in:
ryzendigo 2026-03-16 14:40:40 +08:00
parent 5a214eb0d1
commit 413779ee2a

View File

@ -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