mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 01:32:57 -07:00
Clean up home_stats code
This commit is contained in:
parent
2ea6ae648c
commit
9968f8b6dd
2 changed files with 10 additions and 10 deletions
|
@ -65,7 +65,7 @@ DOCUMENTATION :: END
|
|||
%>
|
||||
|
||||
% if data:
|
||||
% if data[0]['rows'] or data[1]['rows'] or data[2]['rows'] or data[3]['rows'] or data[4]['rows'] or data[5]['rows']:
|
||||
% if data[0]['rows']:
|
||||
<ul class="list-unstyled">
|
||||
% for top_stat in data:
|
||||
% if top_stat['stat_id'] == 'top_tv' and top_stat['rows']:
|
||||
|
|
|
@ -159,7 +159,7 @@ class DataFactory(object):
|
|||
home_stats = []
|
||||
|
||||
for stat in stats_cards:
|
||||
if 'top_tv' in stat:
|
||||
if stat == 'top_tv':
|
||||
top_tv = []
|
||||
try:
|
||||
query = 'SELECT session_history_metadata.id, ' \
|
||||
|
@ -205,7 +205,7 @@ class DataFactory(object):
|
|||
'stat_type': sort_type,
|
||||
'rows': top_tv})
|
||||
|
||||
elif 'popular_tv' in stat:
|
||||
elif stat == 'popular_tv':
|
||||
popular_tv = []
|
||||
try:
|
||||
query = 'SELECT session_history_metadata.id, ' \
|
||||
|
@ -251,7 +251,7 @@ class DataFactory(object):
|
|||
home_stats.append({'stat_id': stat,
|
||||
'rows': popular_tv})
|
||||
|
||||
elif 'top_movies' in stat:
|
||||
elif stat == 'top_movies':
|
||||
top_movies = []
|
||||
try:
|
||||
query = 'SELECT session_history_metadata.id, ' \
|
||||
|
@ -297,7 +297,7 @@ class DataFactory(object):
|
|||
'stat_type': sort_type,
|
||||
'rows': top_movies})
|
||||
|
||||
elif 'popular_movies' in stat:
|
||||
elif stat == 'popular_movies':
|
||||
popular_movies = []
|
||||
try:
|
||||
query = 'SELECT session_history_metadata.id, ' \
|
||||
|
@ -343,7 +343,7 @@ class DataFactory(object):
|
|||
home_stats.append({'stat_id': stat,
|
||||
'rows': popular_movies})
|
||||
|
||||
elif 'top_music' in stat:
|
||||
elif stat == 'top_music':
|
||||
top_music = []
|
||||
try:
|
||||
query = 'SELECT session_history_metadata.id, ' \
|
||||
|
@ -389,7 +389,7 @@ class DataFactory(object):
|
|||
'stat_type': sort_type,
|
||||
'rows': top_music})
|
||||
|
||||
elif 'popular_music' in stat:
|
||||
elif stat == 'popular_music':
|
||||
popular_music = []
|
||||
try:
|
||||
query = 'SELECT session_history_metadata.id, ' \
|
||||
|
@ -435,7 +435,7 @@ class DataFactory(object):
|
|||
home_stats.append({'stat_id': stat,
|
||||
'rows': popular_music})
|
||||
|
||||
elif 'top_users' in stat:
|
||||
elif stat == 'top_users':
|
||||
top_users = []
|
||||
try:
|
||||
query = 'SELECT session_history.user, ' \
|
||||
|
@ -488,7 +488,7 @@ class DataFactory(object):
|
|||
'stat_type': sort_type,
|
||||
'rows': top_users})
|
||||
|
||||
elif 'top_platforms' in stat:
|
||||
elif stat == 'top_platforms':
|
||||
top_platform = []
|
||||
|
||||
try:
|
||||
|
@ -536,7 +536,7 @@ class DataFactory(object):
|
|||
'stat_type': sort_type,
|
||||
'rows': top_platform})
|
||||
|
||||
elif 'last_watched' in stat:
|
||||
elif stat == 'last_watched':
|
||||
last_watched = []
|
||||
try:
|
||||
query = 'SELECT session_history_metadata.id, ' \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue