mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Default to show all cards until the user disables them.
This commit is contained in:
parent
d61e699dc9
commit
de4d8fb277
6 changed files with 18 additions and 10 deletions
|
@ -802,6 +802,6 @@ DOCUMENTATION :: END
|
||||||
<div class="text-muted">No stats for selected period.</div><br>
|
<div class="text-muted">No stats for selected period.</div><br>
|
||||||
% endif
|
% endif
|
||||||
% else:
|
% else:
|
||||||
<div class="text-muted">No cards to show. Please enable cards in the <a href="settings#tab_tabs-2">settings</a>.
|
<div class="text-muted">Unable to retrieve data from database. Please check your <a href="settings">settings</a>.
|
||||||
</div><br>
|
</div><br>
|
||||||
% endif
|
% endif
|
|
@ -73,6 +73,6 @@ DOCUMENTATION :: END
|
||||||
% endfor
|
% endfor
|
||||||
</ul>
|
</ul>
|
||||||
% else:
|
% else:
|
||||||
<div class="text-muted">No cards to show. Please enable cards in the <a href="settings#tab_tabs-2">settings</a>.
|
<div class="text-muted">Unable to retrieve data from server. Please check your <a href="settings">settings</a>.
|
||||||
</div><br>
|
</div><br>
|
||||||
% endif
|
% endif
|
|
@ -86,7 +86,7 @@ _CONFIG_DEFINITIONS = {
|
||||||
'HOME_STATS_LENGTH': (int, 'General', 30),
|
'HOME_STATS_LENGTH': (int, 'General', 30),
|
||||||
'HOME_STATS_TYPE': (int, 'General', 0),
|
'HOME_STATS_TYPE': (int, 'General', 0),
|
||||||
'HOME_STATS_COUNT': (int, 'General', 5),
|
'HOME_STATS_COUNT': (int, 'General', 5),
|
||||||
'HOME_STATS_CARDS': (str, 'General', 'watch_statistics_first'),
|
'HOME_STATS_CARDS': (str, 'General', 'watch_statistics, top_tv, popular_tv, top_movies, popular_movies, top_music, popular_music, top_users, top_platforms, last_watched'),
|
||||||
'HTTPS_CERT': (str, 'General', ''),
|
'HTTPS_CERT': (str, 'General', ''),
|
||||||
'HTTPS_KEY': (str, 'General', ''),
|
'HTTPS_KEY': (str, 'General', ''),
|
||||||
'HTTP_HOST': (str, 'General', '0.0.0.0'),
|
'HTTP_HOST': (str, 'General', '0.0.0.0'),
|
||||||
|
|
|
@ -136,10 +136,9 @@ class DataFactory(object):
|
||||||
|
|
||||||
sort_type = 'total_plays' if stats_type == '0' else 'total_duration'
|
sort_type = 'total_plays' if stats_type == '0' else 'total_duration'
|
||||||
|
|
||||||
stats_queries = stats_cards.split(', ')
|
|
||||||
home_stats = []
|
home_stats = []
|
||||||
|
|
||||||
for stat in stats_queries:
|
for stat in stats_cards:
|
||||||
if 'top_tv' in stat:
|
if 'top_tv' in stat:
|
||||||
top_tv = []
|
top_tv = []
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -1277,8 +1277,6 @@ class PmsConnect(object):
|
||||||
def get_library_stats(self, library_cards=''):
|
def get_library_stats(self, library_cards=''):
|
||||||
server_libraries = self.get_server_children()
|
server_libraries = self.get_server_children()
|
||||||
|
|
||||||
library_keys = library_cards.split(', ')
|
|
||||||
|
|
||||||
server_library_stats = []
|
server_library_stats = []
|
||||||
|
|
||||||
if server_libraries['libraries_count'] != '0':
|
if server_libraries['libraries_count'] != '0':
|
||||||
|
@ -1287,7 +1285,7 @@ class PmsConnect(object):
|
||||||
for library in libraries_list:
|
for library in libraries_list:
|
||||||
library_type = library['type']
|
library_type = library['type']
|
||||||
section_key = library['key']
|
section_key = library['key']
|
||||||
if section_key in library_keys:
|
if section_key in library_cards:
|
||||||
library_list = self.get_library_children(library_type, section_key)
|
library_list = self.get_library_children(library_type, section_key)
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -127,7 +127,7 @@ class WebInterface(object):
|
||||||
time_range = plexpy.CONFIG.HOME_STATS_LENGTH
|
time_range = plexpy.CONFIG.HOME_STATS_LENGTH
|
||||||
stats_type = plexpy.CONFIG.HOME_STATS_TYPE
|
stats_type = plexpy.CONFIG.HOME_STATS_TYPE
|
||||||
stats_count = plexpy.CONFIG.HOME_STATS_COUNT
|
stats_count = plexpy.CONFIG.HOME_STATS_COUNT
|
||||||
stats_cards = plexpy.CONFIG.HOME_STATS_CARDS
|
stats_cards = plexpy.CONFIG.HOME_STATS_CARDS.split(', ')
|
||||||
notify_watched_percent = plexpy.CONFIG.NOTIFY_WATCHED_PERCENT
|
notify_watched_percent = plexpy.CONFIG.NOTIFY_WATCHED_PERCENT
|
||||||
|
|
||||||
stats_data = data_factory.get_home_stats(time_range=time_range,
|
stats_data = data_factory.get_home_stats(time_range=time_range,
|
||||||
|
@ -142,7 +142,18 @@ class WebInterface(object):
|
||||||
def library_stats(self, **kwargs):
|
def library_stats(self, **kwargs):
|
||||||
pms_connect = pmsconnect.PmsConnect()
|
pms_connect = pmsconnect.PmsConnect()
|
||||||
|
|
||||||
library_cards = plexpy.CONFIG.HOME_LIBRARY_CARDS
|
library_cards = plexpy.CONFIG.HOME_LIBRARY_CARDS.split(', ')
|
||||||
|
|
||||||
|
if library_cards == ['library_statistics_first']:
|
||||||
|
library_cards = ['library_statistics']
|
||||||
|
server_children = pms_connect.get_server_children()
|
||||||
|
server_libraries = server_children['libraries_list']
|
||||||
|
|
||||||
|
for library in server_libraries:
|
||||||
|
library_cards.append(library['key'])
|
||||||
|
|
||||||
|
plexpy.CONFIG.HOME_LIBRARY_CARDS = ', '.join(library_cards)
|
||||||
|
plexpy.CONFIG.write()
|
||||||
|
|
||||||
stats_data = pms_connect.get_library_stats(library_cards=library_cards)
|
stats_data = pms_connect.get_library_stats(library_cards=library_cards)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue