Cleanup timeline entries

This commit is contained in:
Nick Mowen 2023-11-05 19:42:51 -07:00
parent 65e3e67a83
commit 4d32e94f05

View File

@ -102,5 +102,11 @@ class TimelineProcessor(threading.Thread):
)[0]
Timeline.insert(timeline_entry).execute()
elif event_type == "end":
if event_data["has_clip"] or event_data["has_snapshot"]:
timeline_entry[Timeline.class_type] = "gone"
Timeline.insert(timeline_entry).execute()
else:
# if event was not saved then the timeline entries should be deleted
Timeline.delete().where(
Timeline.source_id == event_data["id"]
).execute()