mirror of
https://github.com/ep1cman/unifi-protect-backup.git
synced 2025-12-05 23:53:30 +00:00
Filter out on-going events
Unifi Protect has started to return events that have not ended. These are now explicitly filtered out
This commit is contained in:
@@ -77,9 +77,11 @@ class MissingEventChecker:
|
|||||||
if not events_chunk:
|
if not events_chunk:
|
||||||
break # There were no events to backup
|
break # There were no events to backup
|
||||||
|
|
||||||
assert events_chunk[-1].end is not None
|
# Filter out on-going events
|
||||||
start_time = events_chunk[-1].end
|
unifi_events = {event.id: event for event in events_chunk if event.end is not None}
|
||||||
unifi_events = {event.id: event for event in events_chunk}
|
|
||||||
|
# Next chunks start time should be the end of the oldest complete event in the current chunk
|
||||||
|
start_time = max([event.end for event in unifi_events.values()])
|
||||||
|
|
||||||
# Get list of events that have been backed up from the database
|
# Get list of events that have been backed up from the database
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user