mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Combine activity header into one activity function
This commit is contained in:
parent
e80d88c9ff
commit
99f93a8d50
3 changed files with 43 additions and 22 deletions
|
@ -4424,6 +4424,21 @@ class WebInterface(object):
|
|||
if session_key:
|
||||
return next((s for s in result['sessions'] if s['session_key'] == session_key), {})
|
||||
|
||||
|
||||
counts = {'stream_count_direct_play': 0,
|
||||
'stream_count_direct_stream': 0,
|
||||
'stream_count_transcode': 0}
|
||||
|
||||
for s in result['sessions']:
|
||||
if s['transcode_decision'] == 'transcode':
|
||||
counts['stream_count_transcode'] += 1
|
||||
elif s['transcode_decision'] == 'copy':
|
||||
counts['stream_count_direct_stream'] += 1
|
||||
else:
|
||||
counts['stream_count_direct_play'] += 1
|
||||
|
||||
result.update(counts)
|
||||
|
||||
return result
|
||||
else:
|
||||
logger.warn(u"Unable to retrieve data for get_activity.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue