Fix for empty most concurrent stat
This commit is contained in:
@@ -72,6 +72,7 @@ DOCUMENTATION :: END
|
||||
% if data:
|
||||
% if data[0]['stat_id']:
|
||||
<ul class="list-unstyled">
|
||||
% if any(top_stat['rows'] for top_stat in data):
|
||||
% for top_stat in data:
|
||||
% if top_stat['stat_id'] == 'top_tv' and top_stat['rows']:
|
||||
<div class="home-platforms-instance">
|
||||
@@ -852,6 +853,9 @@ DOCUMENTATION :: END
|
||||
</div>
|
||||
% endif
|
||||
% endfor
|
||||
% else:
|
||||
<div class="text-muted">No stats to show for the selected period.</div><br>
|
||||
% endif
|
||||
</ul>
|
||||
<script>
|
||||
var topZIndex = 2;
|
||||
@@ -867,7 +871,7 @@ DOCUMENTATION :: END
|
||||
});
|
||||
</script>
|
||||
% else:
|
||||
<div class="text-muted">No stats for selected period.</div><br>
|
||||
<div class="text-muted">No stats to show for the selected period.</div><br>
|
||||
% endif
|
||||
% else:
|
||||
<div class="text-muted">Unable to retrieve data from database. Please check your <a href="settings">settings</a>.
|
||||
|
@@ -619,28 +619,32 @@ class DataFactory(object):
|
||||
title = 'Concurrent Streams'
|
||||
query = base_query
|
||||
result = monitor_db.select(query)
|
||||
most_concurrent.append(calc_most_concurrent(title, result))
|
||||
if result:
|
||||
most_concurrent.append(calc_most_concurrent(title, result))
|
||||
|
||||
title = 'Concurrent Transcodes'
|
||||
query = base_query \
|
||||
+ 'AND (session_history_media_info.video_decision = "transcode" ' \
|
||||
'OR session_history_media_info.audio_decision = "transcode") '
|
||||
result = monitor_db.select(query)
|
||||
most_concurrent.append(calc_most_concurrent(title, result))
|
||||
if result:
|
||||
most_concurrent.append(calc_most_concurrent(title, result))
|
||||
|
||||
title = 'Concurrent Direct Streams'
|
||||
query = base_query \
|
||||
+ 'AND (session_history_media_info.video_decision != "transcode" ' \
|
||||
'AND session_history_media_info.audio_decision = "copy") '
|
||||
result = monitor_db.select(query)
|
||||
most_concurrent.append(calc_most_concurrent(title, result))
|
||||
if result:
|
||||
most_concurrent.append(calc_most_concurrent(title, result))
|
||||
|
||||
title = 'Concurrent Direct Plays'
|
||||
query = base_query \
|
||||
+ 'AND (session_history_media_info.video_decision = "direct play" ' \
|
||||
'OR session_history_media_info.audio_decision = "direct play") '
|
||||
result = monitor_db.select(query)
|
||||
most_concurrent.append(calc_most_concurrent(title, result))
|
||||
if result:
|
||||
most_concurrent.append(calc_most_concurrent(title, result))
|
||||
except:
|
||||
logger.warn("Unable to execute database query for get_home_stats: most_concurrent.")
|
||||
return None
|
||||
|
Reference in New Issue
Block a user