From b061d083ba2f17c910dcb90a23f71657690b9cf4 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 23 Apr 2025 08:06:31 -0500 Subject: [PATCH] Misc fixes (#17871) * fix check for snapshot score for manual events, snapScore is 0, so "0" gets displayed instead of a condition being evaluated. * fix ongoing events from being returned for all review queries The existing condition will include any record with a null end_time regardless of when it started, as long as the start_time is greater than the after param. With this fix, both the start time needs to be within the specified range, and for events that have already ended, their end time must be before the before param * Base alert toggles on width not device class --------- Co-authored-by: Nicolas Mowen --- frigate/api/review.py | 10 +- .../overlay/detail/SearchDetailDialog.tsx | 2 +- web/src/views/events/EventView.tsx | 97 ++++++++----------- 3 files changed, 47 insertions(+), 62 deletions(-) diff --git a/frigate/api/review.py b/frigate/api/review.py index 977a0aa94..b90365595 100644 --- a/frigate/api/review.py +++ b/frigate/api/review.py @@ -58,13 +58,9 @@ async def review( ) clauses = [ - ( - (ReviewSegment.start_time > after) - & ( - (ReviewSegment.end_time.is_null(True)) - | (ReviewSegment.end_time < before) - ) - ) + (ReviewSegment.start_time > after) + & (ReviewSegment.start_time < before) + & ((ReviewSegment.end_time.is_null(True)) | (ReviewSegment.end_time < before)) ] if cameras != "all": diff --git a/web/src/components/overlay/detail/SearchDetailDialog.tsx b/web/src/components/overlay/detail/SearchDetailDialog.tsx index 9b913ed53..8cbddf63a 100644 --- a/web/src/components/overlay/detail/SearchDetailDialog.tsx +++ b/web/src/components/overlay/detail/SearchDetailDialog.tsx @@ -792,7 +792,7 @@ function ObjectDetailsTab({ {topScore}%{subLabelScore && ` (${subLabelScore}%)`} - {snapScore && ( + {snapScore != undefined && (
diff --git a/web/src/views/events/EventView.tsx b/web/src/views/events/EventView.tsx index a0d904d35..4ce7fcad4 100644 --- a/web/src/views/events/EventView.tsx +++ b/web/src/views/events/EventView.tsx @@ -279,32 +279,29 @@ export default function EventView({ value="alert" aria-label={t("alerts")} > - {isMobileOnly ? ( -
+
+ {reviewCounts.alert > -1 ? ( + reviewCounts.alert + ) : ( + + )} +
+
+ +
+ {t("alerts")} {reviewCounts.alert > -1 ? ( - reviewCounts.alert + ` ∙ ${reviewCounts.alert}` ) : ( - + )}
- ) : ( - <> - -
- {t("alerts")} - {reviewCounts.alert > -1 ? ( - ` ∙ ${reviewCounts.alert}` - ) : ( - - )} -
- - )} +
- {isMobileOnly ? ( -
+
+ {reviewCounts.detection > -1 ? ( + reviewCounts.detection + ) : ( + + )} +
+
+ +
+ {t("detections")} {reviewCounts.detection > -1 ? ( - reviewCounts.detection + ` ∙ ${reviewCounts.detection}` ) : ( - + )}
- ) : ( - <> - -
- {t("detections")} - {reviewCounts.detection > -1 ? ( - ` ∙ ${reviewCounts.detection}` - ) : ( - - )} -
- - )} +
- {isMobileOnly ? ( - - ) : ( - <> - -
{t("motion.label")}
- - )} + +
+ +
{t("motion.label")}
+