store has_clip and has_snapshot on events

This commit is contained in:
Blake Blackshear
2020-12-24 08:09:15 -06:00
parent c770470b58
commit 89e3c2e4b1
3 changed files with 25 additions and 21 deletions

View File

@@ -114,6 +114,8 @@ def events():
zone = request.args.get('zone')
after = request.args.get('after', type=int)
before = request.args.get('before', type=int)
has_clip = request.args.get('has_clip', type=int)
has_snapshot = request.args.get('has_snapshot', type=int)
clauses = []
@@ -132,6 +134,12 @@ def events():
if before:
clauses.append((Event.start_time <= before))
if not has_clip is None:
clauses.append((Event.has_clip == has_clip))
if not has_snapshot is None:
clauses.append((Event.has_snapshot == has_snapshot))
if len(clauses) == 0:
clauses.append((1 == 1))