mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Improved caching and fixed tables
This commit is contained in:
parent
908941fb82
commit
0d7e261bd1
8 changed files with 36 additions and 47 deletions
|
@ -71,20 +71,9 @@ img {
|
||||||
-moz-box-shadow: 0 0 0 3px rgba(0,0,0,.2);
|
-moz-box-shadow: 0 0 0 3px rgba(0,0,0,.2);
|
||||||
box-shadow: 0 0 0 3px rgba(0,0,0,.2);
|
box-shadow: 0 0 0 3px rgba(0,0,0,.2);
|
||||||
}
|
}
|
||||||
.navbar-header {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 15px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.navbar-brand {
|
.navbar-brand {
|
||||||
padding: 5px 5px;
|
padding: 5px 5px;
|
||||||
}
|
}
|
||||||
.navbar-right {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 15px;
|
|
||||||
}
|
|
||||||
.nav > li > a {
|
.nav > li > a {
|
||||||
color: #999;
|
color: #999;
|
||||||
-webkit-transition: all 0.3s ease;
|
-webkit-transition: all 0.3s ease;
|
||||||
|
@ -2575,9 +2564,6 @@ table.display,
|
||||||
table.display tr.shown + tr table[id^='history_child'],
|
table.display tr.shown + tr table[id^='history_child'],
|
||||||
table.display tr.shown + tr table[id^='media_info_child'],
|
table.display tr.shown + tr table[id^='media_info_child'],
|
||||||
table.display tr.shown + tr table[id^='media_info_child'] tr.shown + tr table[id^='media_info_child'] {
|
table.display tr.shown + tr table[id^='media_info_child'] tr.shown + tr table[id^='media_info_child'] {
|
||||||
table-layout: fixed;
|
|
||||||
}
|
|
||||||
table.display.no-fixed {
|
|
||||||
table-layout: auto;
|
table-layout: auto;
|
||||||
}
|
}
|
||||||
table.display tr.shown + tr div.slider {
|
table.display tr.shown + tr div.slider {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body" id="modal-text">
|
<div class="modal-body" id="modal-text">
|
||||||
<table class="display no-fixed" id="history_table" width="100%">
|
<table class="display" id="history_table" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left" id="started">Started</th>
|
<th align="left" id="started">Started</th>
|
||||||
|
|
|
@ -31,11 +31,11 @@
|
||||||
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="row-edit-mode">
|
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="row-edit-mode">
|
||||||
<i class="fa fa-pencil"></i> Edit mode
|
<i class="fa fa-pencil"></i> Edit mode
|
||||||
</button> 
|
</button> 
|
||||||
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select library history to purge. Data is purged upon exiting edit mode.</div>
|
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select libraries to delete/purge. Data is deleted/purged upon exiting edit mode.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='table-card-back'>
|
<div class='table-card-back'>
|
||||||
<table id="libraries_list_table" class="display no-fixed" width="100%">
|
<table id="libraries_list_table" class="display" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left" id="edit_row">Edit</th>
|
<th align="left" id="edit_row">Edit</th>
|
||||||
|
|
|
@ -201,7 +201,7 @@ DOCUMENTATION :: END
|
||||||
% else:
|
% else:
|
||||||
<div id="get_file_sizes_message" style="text-align: center; margin-top: 20px; display: none;">
|
<div id="get_file_sizes_message" style="text-align: center; margin-top: 20px; display: none;">
|
||||||
% endif
|
% endif
|
||||||
<i class="fa fa-refresh fa-spin"></i> PlexPy is getting the file sizes for the library's media info. This could take a few minutes depending on the size of your library.
|
<i class="fa fa-refresh fa-spin"></i> PlexPy is calculating the file sizes for the library's media info. This could take a few minutes depending on the size of your library.
|
||||||
<br />
|
<br />
|
||||||
You may leave this page and come back later.
|
You may leave this page and come back later.
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='table-card-back'>
|
<div class='table-card-back'>
|
||||||
<table class="display no-fixed" id="sync_table" width="100%">
|
<table class="display" id="sync_table" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th align='left' id="state">State</th>
|
<th align='left' id="state">State</th>
|
||||||
|
|
|
@ -218,7 +218,7 @@ from plexpy import helpers
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-card-back">
|
<div class="table-card-back">
|
||||||
<table class="display no-fixed" id="sync_table" width="100%">
|
<table class="display" id="sync_table" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left" id="state">State</th>
|
<th align="left" id="state">State</th>
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='table-card-back'>
|
<div class='table-card-back'>
|
||||||
<table id="users_list_table" class="display no-fixed" width="100%">
|
<table id="users_list_table" class="display" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left" id="edit_row">Edit</th>
|
<th align="left" id="edit_row">Edit</th>
|
||||||
|
|
|
@ -262,7 +262,8 @@ class Libraries(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# If no cache was imported, get all library children items
|
# If no cache was imported, get all library children items
|
||||||
cached_rating_keys = [d['rating_key'] for d in rows]
|
cached_items = {d['rating_key']: d['file_size'] for d in rows}
|
||||||
|
|
||||||
if refresh or not rows:
|
if refresh or not rows:
|
||||||
pms_connect = pmsconnect.PmsConnect()
|
pms_connect = pmsconnect.PmsConnect()
|
||||||
|
|
||||||
|
@ -280,31 +281,33 @@ class Libraries(object):
|
||||||
else:
|
else:
|
||||||
logger.warn(u"PlexPy Libraries :: Unable to get a list of library items.")
|
logger.warn(u"PlexPy Libraries :: Unable to get a list of library items.")
|
||||||
return default_return
|
return default_return
|
||||||
|
|
||||||
for item in children_list:
|
for item in children_list:
|
||||||
if item['rating_key'] not in cached_rating_keys:
|
cached_file_size = cached_items.get(item['rating_key'], None)
|
||||||
row = {'section_id': library_details['section_id'],
|
file_size = cached_file_size if cached_file_size else item.get('file_size', '')
|
||||||
'section_type': library_details['section_type'],
|
|
||||||
'added_at': item['added_at'],
|
row = {'section_id': library_details['section_id'],
|
||||||
'media_type': item['media_type'],
|
'section_type': library_details['section_type'],
|
||||||
'rating_key': item['rating_key'],
|
'added_at': item['added_at'],
|
||||||
'parent_rating_key': item['parent_rating_key'],
|
'media_type': item['media_type'],
|
||||||
'grandparent_rating_key': item['grandparent_rating_key'],
|
'rating_key': item['rating_key'],
|
||||||
'title': item['title'],
|
'parent_rating_key': item['parent_rating_key'],
|
||||||
'year': item['year'],
|
'grandparent_rating_key': item['grandparent_rating_key'],
|
||||||
'media_index': item['media_index'],
|
'title': item['title'],
|
||||||
'parent_media_index': item['parent_media_index'],
|
'year': item['year'],
|
||||||
'thumb': item['thumb'],
|
'media_index': item['media_index'],
|
||||||
'container': item.get('container', ''),
|
'parent_media_index': item['parent_media_index'],
|
||||||
'bitrate': item.get('bitrate', ''),
|
'thumb': item['thumb'],
|
||||||
'video_codec': item.get('video_codec', ''),
|
'container': item.get('container', ''),
|
||||||
'video_resolution': item.get('video_resolution', ''),
|
'bitrate': item.get('bitrate', ''),
|
||||||
'video_framerate': item.get('video_framerate', ''),
|
'video_codec': item.get('video_codec', ''),
|
||||||
'audio_codec': item.get('audio_codec', ''),
|
'video_resolution': item.get('video_resolution', ''),
|
||||||
'audio_channels': item.get('audio_channels', ''),
|
'video_framerate': item.get('video_framerate', ''),
|
||||||
'file_size': item.get('file_size', '')
|
'audio_codec': item.get('audio_codec', ''),
|
||||||
}
|
'audio_channels': item.get('audio_channels', ''),
|
||||||
rows.append(row)
|
'file_size': file_size
|
||||||
|
}
|
||||||
|
rows.append(row)
|
||||||
|
|
||||||
if not rows:
|
if not rows:
|
||||||
return default_return
|
return default_return
|
||||||
|
@ -434,7 +437,7 @@ class Libraries(object):
|
||||||
metadata_list = child_metadata['metadata']
|
metadata_list = child_metadata['metadata']
|
||||||
|
|
||||||
for child_metadata in metadata_list:
|
for child_metadata in metadata_list:
|
||||||
child_file_size = helpers.cast_to_int(child_metadata['file_size'])
|
child_file_size = helpers.cast_to_int(child_metadata.get('file_size', 0))
|
||||||
if child_file_size > 0:
|
if child_file_size > 0:
|
||||||
file_size += child_file_size
|
file_size += child_file_size
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue