mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
naming, values, config und library link update
This commit is contained in:
parent
9fa72c64b8
commit
a772fc0bcf
4 changed files with 46 additions and 8 deletions
|
@ -112,7 +112,7 @@ DOCUMENTATION :: END
|
||||||
% elif stat_id == 'most_concurrent':
|
% elif stat_id == 'most_concurrent':
|
||||||
<div id="stats-thumb-${stat_id}" class="dashboard-stats-flat svg-icon stats-${stat_id} transparent hidden-xs"></div>
|
<div id="stats-thumb-${stat_id}" class="dashboard-stats-flat svg-icon stats-${stat_id} transparent hidden-xs"></div>
|
||||||
% elif stat_id == 'top_libraries':
|
% elif stat_id == 'top_libraries':
|
||||||
<div id="stats-thumb-${stat_id}" class="dashboard-stats-flat svg-icon library-${row0['type']} hidden-xs"></div>
|
<div id="stats-thumb-${stat_id}" class="dashboard-stats-flat svg-icon library-${row0['section_type']} hidden-xs"></div>
|
||||||
% endif
|
% endif
|
||||||
<div class="dashboard-stats-info-container">
|
<div class="dashboard-stats-info-container">
|
||||||
<div id="stats-title-${stat_id}" class="dashboard-stats-info-title">
|
<div id="stats-title-${stat_id}" class="dashboard-stats-info-title">
|
||||||
|
@ -135,7 +135,7 @@ DOCUMENTATION :: END
|
||||||
% for row in top_stat['rows']:
|
% for row in top_stat['rows']:
|
||||||
<li class="dashboard-stats-info-item ${'expanded' if loop.index == 0 else ''}" data-stat_id="${stat_id}"
|
<li class="dashboard-stats-info-item ${'expanded' if loop.index == 0 else ''}" data-stat_id="${stat_id}"
|
||||||
data-rating_key="${row.get('rating_key')}" data-guid="${row.get('guid')}" data-title="${row.get('title')}"
|
data-rating_key="${row.get('rating_key')}" data-guid="${row.get('guid')}" data-title="${row.get('title')}"
|
||||||
data-art="${row.get('art')}" data-thumb="${row.get('thumb')}" data-platform="${row.get('platform_name')}" data-library-type="${row.get('type')}"
|
data-art="${row.get('art')}" data-thumb="${row.get('thumb')}" data-platform="${row.get('platform_name')}" data-library-type="${row.get('section_type')}"
|
||||||
data-user_id="${row.get('user_id')}" data-user="${row.get('user')}" data-friendly_name="${row.get('friendly_name')}" data-user_thumb="${row.get('user_thumb')}"
|
data-user_id="${row.get('user_id')}" data-user="${row.get('user')}" data-friendly_name="${row.get('friendly_name')}" data-user_thumb="${row.get('user_thumb')}"
|
||||||
data-last_watch="${row.get('last_watch')}" data-started="${row.get('started')}" data-live="${row.get('live')}">
|
data-last_watch="${row.get('last_watch')}" data-started="${row.get('started')}" data-live="${row.get('live')}">
|
||||||
<div class="sub-list">${loop.index + 1}</div>
|
<div class="sub-list">${loop.index + 1}</div>
|
||||||
|
@ -162,7 +162,10 @@ DOCUMENTATION :: END
|
||||||
% elif stat_id == 'most_concurrent':
|
% elif stat_id == 'most_concurrent':
|
||||||
${row['title']}
|
${row['title']}
|
||||||
% elif stat_id == 'top_libraries':
|
% elif stat_id == 'top_libraries':
|
||||||
${row['library_name']}
|
<% library_href = page('library', row['section_id']) %>
|
||||||
|
<a href="${library_href}" title="${row['section_name']}">
|
||||||
|
${row['section_name']}
|
||||||
|
</a>
|
||||||
% endif
|
% endif
|
||||||
</div>
|
</div>
|
||||||
<div class="sub-count">
|
<div class="sub-count">
|
||||||
|
|
|
@ -403,6 +403,12 @@
|
||||||
<input type="checkbox" id="hscard-last_watched" name="hscard-last_watched" value="last_watched"> Last Watched
|
<input type="checkbox" id="hscard-last_watched" name="hscard-last_watched" value="last_watched"> Last Watched
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="card card-sortable">
|
||||||
|
<div class="card-handle"><i class="fa fa-bars"></i></div>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" id="hscard-top_libraries" name="hscard-top_libraries" value="top_libraries"> Most Active Libraries
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
<li class="card card-sortable">
|
<li class="card card-sortable">
|
||||||
<div class="card-handle"><i class="fa fa-bars"></i></div>
|
<div class="card-handle"><i class="fa fa-bars"></i></div>
|
||||||
<label>
|
<label>
|
||||||
|
|
|
@ -114,7 +114,7 @@ _CONFIG_DEFINITIONS = {
|
||||||
'HOME_SECTIONS': (list, 'General', ['current_activity', 'watch_stats', 'library_stats', 'recently_added']),
|
'HOME_SECTIONS': (list, 'General', ['current_activity', 'watch_stats', 'library_stats', 'recently_added']),
|
||||||
'HOME_LIBRARY_CARDS': (list, 'General', ['first_run']),
|
'HOME_LIBRARY_CARDS': (list, 'General', ['first_run']),
|
||||||
'HOME_STATS_CARDS': (list, 'General', ['top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music',
|
'HOME_STATS_CARDS': (list, 'General', ['top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music',
|
||||||
'popular_music', 'last_watched', 'top_users', 'top_platforms', 'most_concurrent', 'top_libraries']),
|
'popular_music', 'last_watched', 'top_libraries', 'top_users', 'top_platforms', 'most_concurrent']),
|
||||||
'HOME_REFRESH_INTERVAL': (int, 'General', 10),
|
'HOME_REFRESH_INTERVAL': (int, 'General', 10),
|
||||||
'HTTPS_CREATE_CERT': (int, 'General', 1),
|
'HTTPS_CREATE_CERT': (int, 'General', 1),
|
||||||
'HTTPS_CERT': (str, 'General', ''),
|
'HTTPS_CERT': (str, 'General', ''),
|
||||||
|
@ -546,3 +546,14 @@ class Config(object):
|
||||||
self.PLEXPY_AUTO_UPDATE = 0
|
self.PLEXPY_AUTO_UPDATE = 0
|
||||||
|
|
||||||
self.CONFIG_VERSION = 17
|
self.CONFIG_VERSION = 17
|
||||||
|
|
||||||
|
if self.CONFIG_VERSION == 17:
|
||||||
|
home_stats_cards = self.HOME_STATS_CARDS
|
||||||
|
if 'top_users' in home_stats_cards:
|
||||||
|
top_users_index = home_stats_cards.index('top_users')
|
||||||
|
home_stats_cards.insert(top_users_index, 'top_libraries')
|
||||||
|
else:
|
||||||
|
home_stats_cards.add('top_libaries')
|
||||||
|
self.HOME_STATS_CARDS = home_stats_cards
|
||||||
|
|
||||||
|
self.CONFIG_VERSION = 18
|
|
@ -894,8 +894,10 @@ class DataFactory(object):
|
||||||
top_libraries = []
|
top_libraries = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
query = 'SELECT section_id, section_name, section_type ' \
|
query = 'SELECT section_id, section_name, section_type, thumb AS library_thumb, ' \
|
||||||
'FROM library_sections'
|
'custom_thumb_url AS custom_thumb, art AS library_art, custom_art_url AS custom_art ' \
|
||||||
|
'FROM library_sections ' \
|
||||||
|
'WHERE deleted_section = 0'
|
||||||
|
|
||||||
result = monitor_db.select(query)
|
result = monitor_db.select(query)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -907,11 +909,27 @@ class DataFactory(object):
|
||||||
for item in result:
|
for item in result:
|
||||||
library_item = library_data.get_watch_time_stats(section_id=item['section_id'], grouping=None , query_days=time_range)
|
library_item = library_data.get_watch_time_stats(section_id=item['section_id'], grouping=None , query_days=time_range)
|
||||||
|
|
||||||
|
if item['custom_thumb'] and item['custom_thumb'] != item['library_thumb']:
|
||||||
|
library_thumb = item['custom_thumb']
|
||||||
|
elif item['library_thumb']:
|
||||||
|
library_thumb = item['library_thumb']
|
||||||
|
else:
|
||||||
|
library_thumb = common.DEFAULT_COVER_THUMB
|
||||||
|
|
||||||
|
if item['custom_art'] and item['custom_art'] != item['library_art']:
|
||||||
|
library_art = item['custom_art']
|
||||||
|
else:
|
||||||
|
library_art = item['library_art']
|
||||||
|
|
||||||
row = {
|
row = {
|
||||||
'total_plays': library_item[0]['total_plays'],
|
'total_plays': library_item[0]['total_plays'],
|
||||||
'total_duration': library_item[0]['total_time'],
|
'total_duration': library_item[0]['total_time'],
|
||||||
'type': item['section_type'],
|
'section_type': item['section_type'],
|
||||||
'library_name': item['section_name']
|
'section_name': item['section_name'],
|
||||||
|
'section_id': item['section_id'],
|
||||||
|
'last_play': '',
|
||||||
|
'thumb': library_thumb,
|
||||||
|
'art': library_art
|
||||||
}
|
}
|
||||||
|
|
||||||
top_libraries.append(row)
|
top_libraries.append(row)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue