frigate/frigate/record
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 Ability to manually create events through the API (#3184) 2023-05-19 05:16:11 -05:00
cleanup.py Remove parents in remove_empty_directories (#21726) 2026-02-26 21:27:56 -07:00
export.py Add networking options for configuring listening ports (#21779) 2026-02-26 21:27:56 -07:00
maintainer.py fix: operator precedence makes detection type check always true (#22471) 2026-03-18 09:40:54 -05:00
record.py Require setting process priority for FrigateProcess (#19207) 2025-08-16 10:20:33 -05:00