mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Fix for empty most concurrent stat
This commit is contained in:
parent
3d6f89d309
commit
78ee646558
2 changed files with 13 additions and 5 deletions
|
@ -72,6 +72,7 @@ DOCUMENTATION :: END
|
||||||
% if data:
|
% if data:
|
||||||
% if data[0]['stat_id']:
|
% if data[0]['stat_id']:
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
|
% if any(top_stat['rows'] for top_stat in data):
|
||||||
% for top_stat in data:
|
% for top_stat in data:
|
||||||
% if top_stat['stat_id'] == 'top_tv' and top_stat['rows']:
|
% if top_stat['stat_id'] == 'top_tv' and top_stat['rows']:
|
||||||
<div class="home-platforms-instance">
|
<div class="home-platforms-instance">
|
||||||
|
@ -852,6 +853,9 @@ DOCUMENTATION :: END
|
||||||
</div>
|
</div>
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
|
% else:
|
||||||
|
<div class="text-muted">No stats to show for the selected period.</div><br>
|
||||||
|
% endif
|
||||||
</ul>
|
</ul>
|
||||||
<script>
|
<script>
|
||||||
var topZIndex = 2;
|
var topZIndex = 2;
|
||||||
|
@ -867,7 +871,7 @@ DOCUMENTATION :: END
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
% else:
|
% 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
|
% endif
|
||||||
% else:
|
% else:
|
||||||
<div class="text-muted">Unable to retrieve data from database. Please check your <a href="settings">settings</a>.
|
<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'
|
title = 'Concurrent Streams'
|
||||||
query = base_query
|
query = base_query
|
||||||
result = monitor_db.select(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'
|
title = 'Concurrent Transcodes'
|
||||||
query = base_query \
|
query = base_query \
|
||||||
+ 'AND (session_history_media_info.video_decision = "transcode" ' \
|
+ 'AND (session_history_media_info.video_decision = "transcode" ' \
|
||||||
'OR session_history_media_info.audio_decision = "transcode") '
|
'OR session_history_media_info.audio_decision = "transcode") '
|
||||||
result = monitor_db.select(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 Direct Streams'
|
title = 'Concurrent Direct Streams'
|
||||||
query = base_query \
|
query = base_query \
|
||||||
+ 'AND (session_history_media_info.video_decision != "transcode" ' \
|
+ 'AND (session_history_media_info.video_decision != "transcode" ' \
|
||||||
'AND session_history_media_info.audio_decision = "copy") '
|
'AND session_history_media_info.audio_decision = "copy") '
|
||||||
result = monitor_db.select(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 Direct Plays'
|
title = 'Concurrent Direct Plays'
|
||||||
query = base_query \
|
query = base_query \
|
||||||
+ 'AND (session_history_media_info.video_decision = "direct play" ' \
|
+ 'AND (session_history_media_info.video_decision = "direct play" ' \
|
||||||
'OR session_history_media_info.audio_decision = "direct play") '
|
'OR session_history_media_info.audio_decision = "direct play") '
|
||||||
result = monitor_db.select(query)
|
result = monitor_db.select(query)
|
||||||
most_concurrent.append(calc_most_concurrent(title, result))
|
if result:
|
||||||
|
most_concurrent.append(calc_most_concurrent(title, result))
|
||||||
except:
|
except:
|
||||||
logger.warn("Unable to execute database query for get_home_stats: most_concurrent.")
|
logger.warn("Unable to execute database query for get_home_stats: most_concurrent.")
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue