Skip to content

Commit

Permalink
Handle case where user sets detections as empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed May 30, 2024
1 parent a763ae3 commit 7a0055e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frigate/review/maintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def check_if_new_segment(
if (
not severity
and (
not camera_config.review.detections.labels
camera_config.review.detections.labels is None
or object["label"] in (camera_config.review.detections.labels)
)
and (
Expand Down Expand Up @@ -467,7 +467,7 @@ def run(self) -> None:
current_segment.audio.add(audio)
current_segment.severity = SeverityEnum.alert
elif (
not camera_config.review.detections.labels
camera_config.review.detections.labels is None
or audio in camera_config.review.detections.labels
):
current_segment.audio.add(audio)
Expand Down Expand Up @@ -510,7 +510,7 @@ def run(self) -> None:
detections.add(audio)
severity = SeverityEnum.alert
elif (
not camera_config.review.detections.labels
camera_config.review.detections.labels is None
or audio in camera_config.review.detections.labels
):
detections.add(audio)
Expand Down Expand Up @@ -571,7 +571,7 @@ def get_active_objects(
and (
o["label"] in camera_config.review.alerts.labels
or (
not camera_config.review.detections.labels
camera_config.review.detections.labels is None
or o["label"] in camera_config.review.detections.labels
)
) # object must be in the alerts or detections label list
Expand Down

0 comments on commit 7a0055e

Please sign in to comment.