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
This commit is contained in:
Josh Hawkins 2025-04-23 07:42:24 -05:00
parent f98dd7d31f
commit f5fd42bab0

View File

@ -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 < before)
& ((ReviewSegment.end_time.is_null(True)) | (ReviewSegment.end_time < before))
]
if cameras != "all":