From ec887526663e3ea6aa517e48ae02beb80d8eefd4 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 29 May 2024 18:54:56 -0600 Subject: [PATCH] Don't show mark reviewed button when all items are in progress (#11636) * Don't show mark reviewed button when all items are in progress * Fix unknown preview file --- frigate/output/preview.py | 7 ++++++- web/src/views/events/EventView.tsx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frigate/output/preview.py b/frigate/output/preview.py index 7b89a07e0..31c9ec008 100644 --- a/frigate/output/preview.py +++ b/frigate/output/preview.py @@ -209,7 +209,12 @@ class PreviewRecorder: os.unlink(os.path.join(PREVIEW_CACHE_DIR, file)) continue - ts = float(file.split("-")[1][: -(len(PREVIEW_FRAME_TYPE) + 1)]) + file_time = file.split("-")[1][: -(len(PREVIEW_FRAME_TYPE) + 1)] + + if not file_time: + continue + + ts = float(file_time) if self.start_time == 0: self.start_time = ts diff --git a/web/src/views/events/EventView.tsx b/web/src/views/events/EventView.tsx index 2a4374a3f..5e35aef28 100644 --- a/web/src/views/events/EventView.tsx +++ b/web/src/views/events/EventView.tsx @@ -588,7 +588,7 @@ function DetectionReview({ ))} {!loading && - (currentItems?.length ?? 0) > 0 && + (currentItems?.filter((seg) => seg.end_time)?.length ?? 0) > 0 && (itemsToReview ?? 0) > 0 && (