mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
Fix "unknown" stream resolution in graphs
This commit is contained in:
parent
e1e5a050c2
commit
7175b57a28
1 changed files with 18 additions and 6 deletions
|
@ -698,6 +698,10 @@ class Graphs(object):
|
|||
series_3 = []
|
||||
|
||||
for item in result:
|
||||
if item['resolution'] not in ('4k', 'unknown'):
|
||||
item['resolution'] = item['resolution'].upper()
|
||||
if item['resolution'].isdigit():
|
||||
item['resolution'] += 'p'
|
||||
categories.append(item['resolution'])
|
||||
series_1.append(item['dp_count'])
|
||||
series_2.append(item['ds_count'])
|
||||
|
@ -729,16 +733,18 @@ class Graphs(object):
|
|||
try:
|
||||
if y_axis == 'plays':
|
||||
query = 'SELECT ' \
|
||||
'(CASE WHEN session_history_media_info.stream_video_resolution IS NULL THEN ' \
|
||||
'(CASE WHEN session_history_media_info.video_decision = "transcode" THEN ' \
|
||||
'(CASE ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 360 THEN "sd" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 360 THEN "SD" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 480 THEN "480" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 576 THEN "576" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 720 THEN "720" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 1080 THEN "1080" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 1440 THEN "QHD" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 2160 THEN "4K" ' \
|
||||
'ELSE "unknown" END) ELSE session_history_media_info.video_resolution END) AS resolution, ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 2160 THEN "4k" ' \
|
||||
'ELSE "unknown" END) ELSE session_history_media_info.video_resolution END) ' \
|
||||
'ELSE session_history_media_info.stream_video_resolution END) AS resolution, ' \
|
||||
'SUM(CASE WHEN session_history_media_info.transcode_decision = "direct play" ' \
|
||||
'THEN 1 ELSE 0 END) AS dp_count, ' \
|
||||
'SUM(CASE WHEN session_history_media_info.transcode_decision = "copy" ' \
|
||||
|
@ -758,16 +764,18 @@ class Graphs(object):
|
|||
result = monitor_db.select(query)
|
||||
else:
|
||||
query = 'SELECT ' \
|
||||
'(CASE WHEN session_history_media_info.stream_video_resolution IS NULL THEN ' \
|
||||
'(CASE WHEN session_history_media_info.video_decision = "transcode" THEN ' \
|
||||
'(CASE ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 360 THEN "sd" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 360 THEN "SD" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 480 THEN "480" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 576 THEN "576" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 720 THEN "720" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 1080 THEN "1080" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 1440 THEN "QHD" ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 2160 THEN "4K" ' \
|
||||
'ELSE "unknown" END) ELSE session_history_media_info.video_resolution END) AS resolution, ' \
|
||||
'WHEN session_history_media_info.transcode_height <= 2160 THEN "4k" ' \
|
||||
'ELSE "unknown" END) ELSE session_history_media_info.video_resolution END) ' \
|
||||
'ELSE session_history_media_info.stream_video_resolution END) AS resolution, ' \
|
||||
'SUM(CASE WHEN session_history_media_info.transcode_decision = "direct play" ' \
|
||||
'AND session_history.stopped > 0 THEN (session_history.stopped - session_history.started) ' \
|
||||
' - (CASE WHEN paused_counter IS NULL THEN 0 ELSE paused_counter END) ELSE 0 END) AS dp_count, ' \
|
||||
|
@ -799,6 +807,10 @@ class Graphs(object):
|
|||
series_3 = []
|
||||
|
||||
for item in result:
|
||||
if item['resolution'] not in ('4k', 'unknown'):
|
||||
item['resolution'] = item['resolution'].upper()
|
||||
if item['resolution'].isdigit():
|
||||
item['resolution'] += 'p'
|
||||
categories.append(item['resolution'])
|
||||
series_1.append(item['dp_count'])
|
||||
series_2.append(item['ds_count'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue