frigate/frigate/review
ryzendigo f658dbb158
fix: operator precedence makes detection type check always true (#22471)
* 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

* fix: apply same or operator fix to review/maintainer.py

Same issue as record/maintainer.py — the condition was always true
because the bare enum value is truthy.

* style: ruff format record/maintainer.py
2026-03-18 09:40:54 -05:00
..
__init__.py Create ReviewSegment table in DB for organizing detections to be reviewed (#9918) 2024-02-20 16:26:09 -07:00
maintainer.py fix: operator precedence makes detection type check always true (#22471) 2026-03-18 09:40:54 -05:00
review.py Require setting process priority for FrigateProcess (#19207) 2025-08-16 10:20:33 -05:00
types.py Refactor event cleanup to consider review severity (#15415) 2024-12-09 08:25:45 -07:00