Skip to content
Snippets Groups Projects
Commit 1c687f67 authored by Andreas Valder's avatar Andreas Valder
Browse files

Inserting Zero values for HLS stats, closes #252

parent 6db70161
No related branches found
No related tags found
No related merge requests found
...@@ -41,9 +41,19 @@ def stats_generic(req, param=None): ...@@ -41,9 +41,19 @@ def stats_generic(req, param=None):
if req not in statsqueries: if req not in statsqueries:
return 404, 'Not found' return 404, 'Not found'
rows = query(statsqueries[req], *(statsqueries[req].count('?')*[param])) rows = query(statsqueries[req], *(statsqueries[req].count('?')*[param]))
if req == 'live_views':
res = {'x': [], 'y': []}
else:
res = {} res = {}
lastx = 0
for row in rows: for row in rows:
for key, val in row.items(): for key, val in row.items():
if req == 'live_views' and key == 'x' and lastx != int(val)-1:
for i in range(lastx, int(val)-1):
res['x'].append(i)
res['y'].append(0)
if key == 'x':
lastx = int(val)
if key not in res: if key not in res:
res[key] = [] res[key] = []
res[key].append(val) res[key].append(val)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment