mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-14 01:02:59 -07:00
Add media info table to library page
This commit is contained in:
parent
10e4d562ab
commit
381c3da31c
28 changed files with 1415 additions and 462 deletions
|
@ -71,9 +71,20 @@ img {
|
|||
-moz-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 {
|
||||
padding: 5px 5px;
|
||||
}
|
||||
.navbar-right {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 15px;
|
||||
}
|
||||
.nav > li > a {
|
||||
color: #999;
|
||||
-webkit-transition: all 0.3s ease;
|
||||
|
@ -2542,12 +2553,22 @@ a .home-platforms-instance-list-oval:hover,
|
|||
width: 100%;
|
||||
}
|
||||
}
|
||||
table.display,
|
||||
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'] tr.shown + tr table[id^='media_info_child'] {
|
||||
table-layout: fixed;
|
||||
}
|
||||
table.display.no-fixed {
|
||||
table-layout: auto;
|
||||
}
|
||||
table.display tr.shown + tr div.slider {
|
||||
display: none;
|
||||
}
|
||||
table.display tr.shown + tr > td {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
table.display tr.shown + tr:hover {
|
||||
background-color: rgba(255,255,255,0);
|
||||
|
@ -2558,7 +2579,9 @@ table.display tr.shown + tr .pagination > .active > a,
|
|||
table.display tr.shown + tr .pagination > .active > a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
table.display tr.shown + tr table[id^='history_child'] td:hover a {
|
||||
table.display tr.shown + tr table[id^='history_child'] td:hover a,
|
||||
table.display tr.shown + tr table[id^='media_info_child'] > tr > td:hover a,
|
||||
table.display tr.shown + tr table[id^='media_info_child'] tr.shown + tr table[id^='media_info_child'] td:hover a {
|
||||
color: #F9AA03;
|
||||
}
|
||||
table.display tr.shown + tr .pagination > .disabled > a {
|
||||
|
@ -2569,14 +2592,22 @@ table.display tr.shown + tr .pagination > li > a:hover {
|
|||
}
|
||||
table[id^='history_child'] {
|
||||
margin-top: 0;
|
||||
margin-left: -4px;
|
||||
opacity: .6;
|
||||
}
|
||||
table[id^='history_child'] thead th {
|
||||
table[id^='media_info_child'] {
|
||||
margin-top: 0;
|
||||
}
|
||||
table[id^='history_child'] thead th,
|
||||
table[id^='media_info_child'] thead th {
|
||||
line-height: 0;
|
||||
height: 0 !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
table[id^='media_info_child'] table[id^='media_info_child'] thead th {
|
||||
line-height: 25px;
|
||||
height: 35px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
#search_form {
|
||||
width: 300px;
|
||||
padding: 8px 15px;
|
||||
|
|
|
@ -25,18 +25,18 @@
|
|||
<table class="display" id="history_table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align='left' id="delete_row">Delete</th>
|
||||
<th align='left' id="time">Time</th>
|
||||
<th align='left' id="friendly_name">User</th>
|
||||
<th align='left' id="ip_address">IP Address</th>
|
||||
<th align='left' id="platform">Platform</th>
|
||||
<th align='left' id="device">Player</th>
|
||||
<th align='left' id="title">Title</th>
|
||||
<th align='left' id="started">Started</th>
|
||||
<th align='left' id="paused_counter">Paused</th>
|
||||
<th align='left' id="stopped">Stopped</th>
|
||||
<th align='left' id="duration">Duration</th>
|
||||
<th align='left' id="percent_complete"></th>
|
||||
<th align="left" id="delete_row">Delete</th>
|
||||
<th align="left" id="time">Time</th>
|
||||
<th align="left" id="friendly_name">User</th>
|
||||
<th align="left" id="ip_address">IP Address</th>
|
||||
<th align="left" id="platform">Platform</th>
|
||||
<th align="left" id="device">Player</th>
|
||||
<th align="left" id="title">Title</th>
|
||||
<th align="left" id="started">Started</th>
|
||||
<th align="left" id="paused_counter">Paused</th>
|
||||
<th align="left" id="stopped">Stopped</th>
|
||||
<th align="left" id="duration">Duration</th>
|
||||
<th align="left" id="percent_complete"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -83,8 +83,8 @@
|
|||
type: 'post',
|
||||
data: function (d) {
|
||||
return {
|
||||
'json_data': JSON.stringify(d),
|
||||
'media_type': media_type
|
||||
json_data: JSON.stringify(d),
|
||||
media_type: media_type
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="modal-text">
|
||||
<table class="display" id="history_table" width="100%">
|
||||
<table class="display no-fixed" id="history_table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align='left' id="started">Started</th>
|
||||
<th align='left' id="stopped">Stopped</th>
|
||||
<th align='left' id="friendly_name">User</th>
|
||||
<th align='left' id="player">Player</th>
|
||||
<th align='left' id="title">Title</th>
|
||||
<th align="left" id="started">Started</th>
|
||||
<th align="left" id="stopped">Stopped</th>
|
||||
<th align="left" id="friendly_name">User</th>
|
||||
<th align="left" id="player">Player</th>
|
||||
<th align="left" id="title">Title</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -34,13 +34,14 @@
|
|||
$(document).ready(function() {
|
||||
$('#date-header').html(moment('${data}','YYYY-MM-DD').format('ddd MMM Do YYYY'));
|
||||
history_table_modal_options.ajax = {
|
||||
"url": "get_history",
|
||||
url: 'get_history',
|
||||
type: "post",
|
||||
data: function ( d ) {
|
||||
return { 'json_data': JSON.stringify( d ),
|
||||
'grouping': false,
|
||||
'start_date': '${data}'
|
||||
};
|
||||
return {
|
||||
json_data: JSON.stringify(d),
|
||||
grouping: false,
|
||||
start_date: '${data}'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,29 +54,29 @@ DOCUMENTATION :: END
|
|||
<div class="summary-navbar-list">
|
||||
<ul class="list-unstyled breadcrumb">
|
||||
% if data['media_type'] == 'movie':
|
||||
<li><a href="library?section_id=${data['library_id']}">${data['library_name']}</a></li>
|
||||
<li><a href="library?section_id=${data['section_id']}">${data['library_name']}</a></li>
|
||||
<li class="active">${data['title']}</li>
|
||||
% elif data['media_type'] == 'show':
|
||||
<li><a href="library?section_id=${data['library_id']}">${data['library_name']}</a></li>
|
||||
<li><a href="library?section_id=${data['section_id']}">${data['library_name']}</a></li>
|
||||
<li class="active">${data['title']}</li>
|
||||
% elif data['media_type'] == 'season':
|
||||
<li class="hidden-xs hidden-sm"><a href="library?section_id=${data['library_id']}">${data['library_name']}</a></li>
|
||||
<li class="hidden-xs hidden-sm"><a href="library?section_id=${data['section_id']}">${data['library_name']}</a></li>
|
||||
<li><a href="info?rating_key=${data['parent_rating_key']}">${data['parent_title']}</a></li>
|
||||
<li class="active">Season ${data['media_index']}</li>
|
||||
% elif data['media_type'] == 'episode':
|
||||
<li class="hidden-xs hidden-sm"><a href="library?section_id=${data['library_id']}">${data['library_name']}</a></li>
|
||||
<li class="hidden-xs hidden-sm"><a href="library?section_id=${data['section_id']}">${data['library_name']}</a></li>
|
||||
<li class="hidden-xs hidden-sm"><a href="info?rating_key=${data['grandparent_rating_key']}">${data['grandparent_title']}</a></li>
|
||||
<li><a href="info?rating_key=${data['parent_rating_key']}">Season ${data['parent_media_index']}</a></li>
|
||||
<li class="active">Episode ${data['media_index']} - ${data['title']}</li>
|
||||
% elif data['media_type'] == 'artist':
|
||||
<li><a href="library?section_id=${data['library_id']}">${data['library_name']}</a></li>
|
||||
<li><a href="library?section_id=${data['section_id']}">${data['library_name']}</a></li>
|
||||
<li class="active">${data['title']}</li>
|
||||
% elif data['media_type'] == 'album':
|
||||
<li class="hidden-xs hidden-sm"><a href="library?section_id=${data['library_id']}">${data['library_name']}</a></li>
|
||||
<li class="hidden-xs hidden-sm"><a href="library?section_id=${data['section_id']}">${data['library_name']}</a></li>
|
||||
<li><a href="info?rating_key=${data['parent_rating_key']}">${data['parent_title']}</a></li>
|
||||
<li class="active">${data['title']}</li>
|
||||
% elif data['media_type'] == 'track':
|
||||
<li class="hidden-xs hidden-sm"><a href="library?section_id=${data['library_id']}">${data['library_name']}</a></li>
|
||||
<li class="hidden-xs hidden-sm"><a href="library?section_id=${data['section_id']}">${data['library_name']}</a></li>
|
||||
<li class="hidden-xs hidden-sm"><a href="info?rating_key=${data['grandparent_rating_key']}">${data['grandparent_title']}</a></li>
|
||||
<li><a href="info?rating_key=${data['parent_rating_key']}">${data['parent_title']}</a></li>
|
||||
<li class="active">Track ${data['media_index']} - ${data['title']}</li>
|
||||
|
@ -288,14 +288,6 @@ DOCUMENTATION :: END
|
|||
</div>
|
||||
% endif
|
||||
<div class='col-md-12'>
|
||||
<!-- Need to find a place to put this -->
|
||||
% if data['media_type'] == 'library' and config['update_library_ids'] == 1:
|
||||
<div id="update_library_ids_mssage" style="text-align: center; margin-top: 20px;">
|
||||
<i class="fa fa-refresh fa-spin"></i> Updating library ids in the database. This could take a few minutes depending on the size of your database.
|
||||
<br />
|
||||
The history table will refresh automatically when the update is complete. Please wait...
|
||||
</div>
|
||||
% endif
|
||||
<div class='table-card-header'>
|
||||
<div class="header-bar">
|
||||
<span>Watch History for <strong>${data['title']}</strong></span>
|
||||
|
@ -370,41 +362,17 @@ DOCUMENTATION :: END
|
|||
% if data:
|
||||
<script src="interfaces/default/js/tables/history_table.js"></script>
|
||||
<!-- Need to find a place to put this -->
|
||||
% if data['media_type'] == 'library':
|
||||
% if data['media_type'] == 'show' or data['media_type'] == 'artist':
|
||||
<script>
|
||||
function get_history() {
|
||||
history_table_options.ajax = {
|
||||
url: 'get_history',
|
||||
type: 'post',
|
||||
data: function ( d ) {
|
||||
return { 'json_data': JSON.stringify( d ),
|
||||
'library_id': "${data['library_id']}" };
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("${config['update_library_ids']}" == "1") {
|
||||
$.ajax({
|
||||
url: 'update_library_ids',
|
||||
type: 'post',
|
||||
cache: false,
|
||||
async: true,
|
||||
data: { },
|
||||
complete: function (xhr, status) {
|
||||
$('#update_library_ids_mssage').remove();
|
||||
history_table.draw();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
% elif data['media_type'] == 'show' or data['media_type'] == 'artist':
|
||||
<script>
|
||||
function get_history() {
|
||||
history_table_options.ajax = {
|
||||
url: 'get_history',
|
||||
type: 'post',
|
||||
data: function ( d ) {
|
||||
return { 'json_data': JSON.stringify( d ),
|
||||
'grandparent_rating_key': "${data['rating_key']}" };
|
||||
return {
|
||||
json_data: JSON.stringify( d ),
|
||||
grandparent_rating_key: "${data['rating_key']}"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -416,8 +384,10 @@ DOCUMENTATION :: END
|
|||
url: 'get_history',
|
||||
type: 'post',
|
||||
data: function ( d ) {
|
||||
return { 'json_data': JSON.stringify( d ),
|
||||
'parent_rating_key': "${data['rating_key']}" };
|
||||
return {
|
||||
json_data: JSON.stringify( d ),
|
||||
parent_rating_key: "${data['rating_key']}"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -429,8 +399,10 @@ DOCUMENTATION :: END
|
|||
url: 'get_history',
|
||||
type: 'post',
|
||||
data: function ( d ) {
|
||||
return { 'json_data': JSON.stringify( d ),
|
||||
'rating_key': "${data['rating_key']}" };
|
||||
return {
|
||||
json_data: JSON.stringify( d ),
|
||||
rating_key: "${data['rating_key']}"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ history_table_options = {
|
|||
}
|
||||
},
|
||||
"searchable": false,
|
||||
"width": "8%",
|
||||
"width": "7%",
|
||||
"className": "no-wrap expand-history"
|
||||
},
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ history_table_options = {
|
|||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"width": "8%",
|
||||
"width": "7%",
|
||||
"className": "no-wrap hidden-xs"
|
||||
},
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ history_table_options = {
|
|||
$(td).html('n/a');
|
||||
}
|
||||
},
|
||||
"width": "8%",
|
||||
"width": "7%",
|
||||
"className": "no-wrap hidden-md hidden-sm hidden-xs modal-control-ip"
|
||||
},
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ history_table_options = {
|
|||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"width": "8%",
|
||||
"width": "7%",
|
||||
"className": "no-wrap hidden-md hidden-sm hidden-xs modal-control"
|
||||
},
|
||||
{
|
||||
|
@ -153,7 +153,7 @@ history_table_options = {
|
|||
}
|
||||
}
|
||||
},
|
||||
"width": "35%"
|
||||
"width": "33%"
|
||||
},
|
||||
{
|
||||
"targets": [7],
|
||||
|
@ -226,7 +226,7 @@ history_table_options = {
|
|||
"searchable": false,
|
||||
"orderable": false,
|
||||
"className": "no-wrap hidden-md hidden-sm hidden-xs",
|
||||
"width": "1%"
|
||||
"width": "2%"
|
||||
},
|
||||
],
|
||||
"drawCallback": function (settings) {
|
||||
|
@ -260,7 +260,7 @@ history_table_options = {
|
|||
var rowData = this.data();
|
||||
if (rowData['group_count'] != 1 && rowData['reference_id'] in history_child_table) {
|
||||
// if grouped row and a child table was already created
|
||||
$(this.node()).find('i.fa').toggleClass('fa-plus-circle').toggleClass('fa-minus-circle');
|
||||
$(this.node()).find('i.fa.fa-plus-circle').toggleClass('fa-plus-circle').toggleClass('fa-minus-circle');
|
||||
this.child(childTableFormat(rowData)).show();
|
||||
createChildTable(this, rowData)
|
||||
}
|
||||
|
@ -426,13 +426,13 @@ function childTableOptions(rowData) {
|
|||
history_child_options.pageLength = 10;
|
||||
history_child_options.bStateSave = false;
|
||||
history_child_options.ajax = {
|
||||
"url": "get_history",
|
||||
type: "post",
|
||||
url: 'get_history',
|
||||
type: 'post',
|
||||
data: function (d) {
|
||||
return {
|
||||
'json_data': JSON.stringify(d),
|
||||
'grouping': false,
|
||||
'reference_id': rowData['reference_id']
|
||||
json_data: JSON.stringify(d),
|
||||
grouping: false,
|
||||
reference_id: rowData['reference_id']
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -469,7 +469,7 @@ function childTableOptions(rowData) {
|
|||
// Format the detailed history child table
|
||||
function childTableFormat(rowData) {
|
||||
return '<div class="slider">' +
|
||||
'<table id="history_child-' + rowData['reference_id'] + '">' +
|
||||
'<table id="history_child-' + rowData['reference_id'] + '" width="100%">' +
|
||||
'<thead>' +
|
||||
'<tr>' +
|
||||
'<th align="left" id="delete_row">Delete</th>' +
|
||||
|
|
|
@ -39,7 +39,7 @@ history_table_modal_options = {
|
|||
},
|
||||
"searchable": false,
|
||||
"className": "no-wrap",
|
||||
"width": "5%"
|
||||
"width": "10%"
|
||||
},
|
||||
{
|
||||
"targets": [1],
|
||||
|
@ -53,7 +53,7 @@ history_table_modal_options = {
|
|||
},
|
||||
"searchable": false,
|
||||
"className": "no-wrap",
|
||||
"width": "5%"
|
||||
"width": "10%"
|
||||
},
|
||||
{
|
||||
"targets": [2],
|
||||
|
@ -69,7 +69,8 @@ history_table_modal_options = {
|
|||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"className": "no-wrap hidden-xs"
|
||||
"className": "no-wrap hidden-xs",
|
||||
"width": "15%"
|
||||
},
|
||||
{
|
||||
"targets": [3],
|
||||
|
@ -87,7 +88,8 @@ history_table_modal_options = {
|
|||
$(td).html('<div><a href="#" data-target="#info-modal" data-toggle="modal"><div style="float: left;">' + transcode_dec + ' ' + cellData + '</div></a></div>');
|
||||
}
|
||||
},
|
||||
"className": "no-wrap hidden-sm hidden-xs modal-control"
|
||||
"className": "no-wrap hidden-sm hidden-xs modal-control",
|
||||
"width": "20%"
|
||||
},
|
||||
{
|
||||
"targets": [4],
|
||||
|
@ -113,7 +115,8 @@ history_table_modal_options = {
|
|||
$(td).html('<a href="info?rating_key=' + rowData['rating_key'] + '">' + cellData + '</a>');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"width": "30%"
|
||||
}
|
||||
],
|
||||
"drawCallback": function (settings) {
|
||||
|
|
|
@ -14,7 +14,7 @@ libraries_list_table_options = {
|
|||
"processing": false,
|
||||
"serverSide": true,
|
||||
"pageLength": 10,
|
||||
"order": [ 1, 'asc'],
|
||||
"order": [ 2, 'asc'],
|
||||
"autoWidth": true,
|
||||
"stateSave": true,
|
||||
"pagingType": "bootstrap",
|
||||
|
@ -40,14 +40,14 @@ libraries_list_table_options = {
|
|||
"targets": [1],
|
||||
"data": "library_thumb",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData === '') {
|
||||
$(td).html('<a href="library?section_id=' + rowData['section_id'] + '"><div class="libraries-poster-face" style="background-image: url(interfaces/default/images/cover.png);"></div></a>');
|
||||
} else {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
if (rowData['library_thumb'].substring(0, 4) == "http") {
|
||||
$(td).html('<a href="library?section_id=' + rowData['section_id'] + '"><div class="libraries-poster-face" style="background-image: url(' + rowData['library_thumb'] + ');"></div></a>');
|
||||
} else {
|
||||
$(td).html('<a href="library?section_id=' + rowData['section_id'] + '"><div class="libraries-poster-face" style="background-image: url(pms_image_proxy?img=' + rowData['library_thumb'] + '&width=80&height=80&fallback=poster);"></div></a>');
|
||||
}
|
||||
} else {
|
||||
$(td).html('<a href="library?section_id=' + rowData['section_id'] + '"><div class="libraries-poster-face" style="background-image: url(interfaces/default/images/cover.png);"></div></a>');
|
||||
}
|
||||
},
|
||||
"orderable": false,
|
||||
|
@ -59,12 +59,12 @@ libraries_list_table_options = {
|
|||
"targets": [2],
|
||||
"data": "section_name",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== '') {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html('<div data-id="' + rowData['section_id'] + '">' +
|
||||
'<a href="library?section_id=' + rowData['section_id'] + '">' + cellData + '</a>' +
|
||||
'</div>');
|
||||
} else {
|
||||
$(td).html(cellData);
|
||||
$(td).html('n/a');
|
||||
}
|
||||
},
|
||||
"width": "10%",
|
||||
|
@ -74,7 +74,7 @@ libraries_list_table_options = {
|
|||
"targets": [3],
|
||||
"data": "section_type",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== '') {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
|
@ -85,10 +85,8 @@ libraries_list_table_options = {
|
|||
"targets": [4],
|
||||
"data": "count",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
} else {
|
||||
$(td).html('n/a');
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -99,10 +97,8 @@ libraries_list_table_options = {
|
|||
"targets": [5],
|
||||
"data": "parent_count",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
} else {
|
||||
$(td).html('n/a');
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -113,10 +109,8 @@ libraries_list_table_options = {
|
|||
"targets": [6],
|
||||
"data": "child_count",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
} else {
|
||||
$(td).html('n/a');
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -126,11 +120,11 @@ libraries_list_table_options = {
|
|||
{
|
||||
"targets": [7],
|
||||
"data": "last_accessed",
|
||||
"render": function (data, type, full) {
|
||||
if (data) {
|
||||
return moment(data, "X").fromNow();
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(moment(cellData, "X").fromNow());
|
||||
} else {
|
||||
return "never";
|
||||
$(td).html("never");
|
||||
}
|
||||
},
|
||||
"searchable": false,
|
||||
|
@ -141,7 +135,7 @@ libraries_list_table_options = {
|
|||
"targets": [8],
|
||||
"data":"last_watched",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== '') {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
var media_type = '';
|
||||
var thumb_popover = ''
|
||||
if (rowData['media_type'] === 'movie') {
|
||||
|
@ -158,9 +152,9 @@ libraries_list_table_options = {
|
|||
$(td).html('<div class="history-title"><a href="info?source=history&rating_key=' + rowData['rating_key'] + '"><div style="float: left;">' + media_type + ' ' + thumb_popover + '</div></a></div>');
|
||||
} else if (rowData['media_type']) {
|
||||
$(td).html('<a href="info?rating_key=' + rowData['rating_key'] + '">' + cellData + '</a>');
|
||||
} else {
|
||||
$(td).html('n/a');
|
||||
}
|
||||
} else {
|
||||
$(td).html('n/a');
|
||||
}
|
||||
},
|
||||
"width": "25%",
|
||||
|
|
420
data/interfaces/default/js/tables/media_info_table.js
Normal file
420
data/interfaces/default/js/tables/media_info_table.js
Normal file
|
@ -0,0 +1,420 @@
|
|||
var date_format = 'YYYY-MM-DD';
|
||||
var time_format = 'hh:mm a';
|
||||
|
||||
$.ajax({
|
||||
url: 'get_date_formats',
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
date_format = data.date_format;
|
||||
time_format = data.time_format;
|
||||
}
|
||||
});
|
||||
|
||||
media_info_table_options = {
|
||||
"destroy": true,
|
||||
"language": {
|
||||
"search": "Search: ",
|
||||
"lengthMenu":"Show _MENU_ entries per page",
|
||||
"info":"Showing _START_ to _END_ of _TOTAL_ library items",
|
||||
"infoEmpty":"Showing 0 to 0 of 0 entries",
|
||||
"infoFiltered":"<span class='hidden-md hidden-sm hidden-xs'>(filtered from _MAX_ total entries)</span>",
|
||||
"emptyTable": "No data in table"
|
||||
},
|
||||
"pagingType": "bootstrap",
|
||||
"stateSave": true,
|
||||
"processing": false,
|
||||
"serverSide": true,
|
||||
"pageLength": 25,
|
||||
"order": [ 1, 'asc'],
|
||||
"autoWidth": false,
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": [0],
|
||||
"data": "added_at",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
var expand_details = '';
|
||||
var date = moment(cellData, "X").format(date_format);
|
||||
if (rowData['media_type'] === 'show') {
|
||||
expand_details = '<span class="expand-media-info-tooltip" data-toggle="tooltip" title="Show Seasons"><i class="fa fa-plus-circle fa-fw"></i></span>';
|
||||
$(td).html('<div><a href="#"><div style="float: left;">' + expand_details + ' ' + date + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'season') {
|
||||
expand_details = '<span class="expand-media-info-tooltip" data-toggle="tooltip" title="Show Episodes"><i class="fa fa-plus-circle fa-fw"></i></span>';
|
||||
$(td).html('<div><a href="#"><div style="float: left;">' + expand_details + ' ' + date + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'artist') {
|
||||
expand_details = '<span class="expand-media-info-tooltip" data-toggle="tooltip" title="Show Albumns"><i class="fa fa-plus-circle fa-fw"></i></span>';
|
||||
$(td).html('<div><a href="#"><div style="float: left;">' + expand_details + ' ' + date + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'album') {
|
||||
expand_details = '<span class="expand-media-info-tooltip" data-toggle="tooltip" title="Show Tracks"><i class="fa fa-plus-circle fa-fw"></i></span>';
|
||||
$(td).html('<div><a href="#"><div style="float: left;">' + expand_details + ' ' + date + '</div></a></div>');
|
||||
} else {
|
||||
$(td).html('<div style="float: left;"><i class="fa fa-fw"></i> ' + date + '</div>');
|
||||
}
|
||||
}
|
||||
},
|
||||
"width": "7%",
|
||||
"className": "no-wrap expand-media-info",
|
||||
"searchable": false
|
||||
},
|
||||
{
|
||||
"targets": [1],
|
||||
"data": "title",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
var media_type = '';
|
||||
var thumb_popover = '';
|
||||
if (rowData['media_type'] === 'movie') {
|
||||
media_type = '<span class="media-type-tooltip" data-toggle="tooltip" title="Movie"><i class="fa fa-film fa-fw"></i></span>';
|
||||
thumb_popover = '<span class="thumb-tooltip" data-toggle="popover" data-img="pms_image_proxy?img=' + rowData['thumb'] + '&width=300&height=450&fallback=poster" data-height="120">' + cellData + ' (' + rowData['year'] + ')</span>'
|
||||
$(td).html('<div class="history-title"><a href="info?rating_key=' + rowData['rating_key'] + '"><div style="float: left;">' + media_type + ' ' + thumb_popover + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'show') {
|
||||
media_type = '<span class="media-type-tooltip" data-toggle="tooltip" title="TV Show"><i class="fa fa-television fa-fw"></i></span>';
|
||||
thumb_popover = '<span class="thumb-tooltip" data-toggle="popover" data-img="pms_image_proxy?img=' + rowData['thumb'] + '&width=300&height=450&fallback=poster" data-height="120">' + cellData + '</span>'
|
||||
$(td).html('<div class="history-title"><a href="info?rating_key=' + rowData['rating_key'] + '"><div style="float: left;">' + media_type + ' ' + thumb_popover + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'season') {
|
||||
media_type = '<span class="media-type-tooltip" data-toggle="tooltip" title="Season"><i class="fa fa-television fa-fw"></i></span>';
|
||||
thumb_popover = '<span class="thumb-tooltip" data-toggle="popover" data-img="pms_image_proxy?img=' + rowData['thumb'] + '&width=300&height=450&fallback=poster" data-height="120">' + cellData + '</span>'
|
||||
$(td).html('<div class="history-title"><a href="info?rating_key=' + rowData['rating_key'] + '"><div style="float: left; padding-left: 15px;">' + media_type + ' ' + thumb_popover + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'episode') {
|
||||
media_type = '<span class="media-type-tooltip" data-toggle="tooltip" title="Episode"><i class="fa fa-television fa-fw"></i></span>';
|
||||
thumb_popover = '<span class="thumb-tooltip" data-toggle="popover" data-img="pms_image_proxy?img=' + rowData['thumb'] + '&width=300&height=450&fallback=poster" data-height="120">E' + rowData['media_index'] + ' - ' + cellData + '</span>'
|
||||
$(td).html('<div class="history-title"><a href="info?rating_key=' + rowData['rating_key'] + '"><div style="float: left; padding-left: 30px;">' + media_type + ' ' + thumb_popover + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'artist') {
|
||||
media_type = '<span class="media-type-tooltip" data-toggle="tooltip" title="Artist"><i class="fa fa-music fa-fw"></i></span>';
|
||||
thumb_popover = '<span class="thumb-tooltip" data-toggle="popover" data-img="pms_image_proxy?img=' + rowData['thumb'] + '&width=300&height=300&fallback=poster" data-height="80">' + cellData + '</span>'
|
||||
$(td).html('<div class="history-title"><a href="info?rating_key=' + rowData['rating_key'] + '"><div style="float: left;">' + media_type + ' ' + thumb_popover + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'album') {
|
||||
media_type = '<span class="media-type-tooltip" data-toggle="tooltip" title="Album"><i class="fa fa-music fa-fw"></i></span>';
|
||||
thumb_popover = '<span class="thumb-tooltip" data-toggle="popover" data-img="pms_image_proxy?img=' + rowData['thumb'] + '&width=300&height=300&fallback=poster" data-height="80">' + cellData + '</span>'
|
||||
$(td).html('<div class="history-title"><a href="info?rating_key=' + rowData['rating_key'] + '"><div style="float: left; padding-left: 15px;">' + media_type + ' ' + thumb_popover + '</div></a></div>');
|
||||
} else if (rowData['media_type'] === 'track') {
|
||||
media_type = '<span class="media-type-tooltip" data-toggle="tooltip" title="Track"><i class="fa fa-music fa-fw"></i></span>';
|
||||
thumb_popover = '<span class="thumb-tooltip" data-toggle="popover" data-img="pms_image_proxy?img=' + rowData['thumb'] + '&width=300&height=300&fallback=poster" data-height="80">T' + rowData['media_index'] + ' - ' + cellData + '</span>'
|
||||
$(td).html('<div class="history-title"><a href="info?rating_key=' + rowData['rating_key'] + '"><div style="float: left; padding-left: 30px;">' + media_type + ' ' + thumb_popover + '</div></a></div>');
|
||||
} else {
|
||||
$(td).html('<a href="info?rating_key=' + rowData['rating_key'] + '">' + cellData + '</a>');
|
||||
}
|
||||
}
|
||||
},
|
||||
"width": "26%"
|
||||
},
|
||||
{
|
||||
"targets": [2],
|
||||
"data": "container",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"width": "5%",
|
||||
"className": "no-wrap hidden-sm hidden-xs"
|
||||
},
|
||||
{
|
||||
"targets": [3],
|
||||
"data": "bitrate",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData + ' kbps');
|
||||
}
|
||||
},
|
||||
"width": "5%",
|
||||
"className": "no-wrap hidden-md hidden-sm hidden-xs",
|
||||
"searchable": false
|
||||
},
|
||||
{
|
||||
"targets": [4],
|
||||
"data": "video_codec",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"width": "8%",
|
||||
"className": "no-wrap hidden-sm hidden-xs"
|
||||
},
|
||||
{
|
||||
"targets": [5],
|
||||
"data": "video_resolution",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"width": "8%",
|
||||
"className": "no-wrap hidden-md hidden-sm hidden-xs"
|
||||
},
|
||||
{
|
||||
"targets": [6],
|
||||
"data": "video_framerate",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"width": "8%",
|
||||
"className": "no-wrap hidden-md hidden-sm hidden-xs"
|
||||
},
|
||||
{
|
||||
"targets": [7],
|
||||
"data": "audio_codec",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"width": "8%",
|
||||
"className": "no-wrap hidden-sm hidden-xs"
|
||||
},
|
||||
{
|
||||
"targets": [8],
|
||||
"data": "audio_channels",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData + ' ch');
|
||||
}
|
||||
},
|
||||
"width": "8%",
|
||||
"className": "no-wrap hidden-md hidden-sm hidden-xs"
|
||||
},
|
||||
{
|
||||
"targets": [9],
|
||||
"data": "file_size",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(Math.round(cellData / 1024 / 1000).toString() + ' MB');
|
||||
}
|
||||
},
|
||||
"width": "5%",
|
||||
"className": "no-wrap hidden-md hidden-sm hidden-xs",
|
||||
"searchable": false
|
||||
},
|
||||
{
|
||||
"targets": [10],
|
||||
"data": "last_watched",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
date = moment(cellData, "X").format(date_format);
|
||||
$(td).html(date);
|
||||
}
|
||||
},
|
||||
"width": "7%",
|
||||
"className": "no-wrap hidden-xs",
|
||||
"searchable": false
|
||||
},
|
||||
{
|
||||
"targets": [11],
|
||||
"data": "play_count",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"width": "5%",
|
||||
"className": "no-wrap hidden-xs",
|
||||
"searchable": false
|
||||
}
|
||||
],
|
||||
"drawCallback": function (settings) {
|
||||
// Jump to top of page
|
||||
// $('html,body').scrollTop(0);
|
||||
$('#ajaxMsg').fadeOut();
|
||||
|
||||
// Create the tooltips.
|
||||
$('.expand-media-info-tooltip').tooltip({ container: 'body' });
|
||||
$('.media-type-tooltip').tooltip({ container: 'body' });
|
||||
$('.thumb-tooltip').popover({
|
||||
html: true,
|
||||
container: 'body',
|
||||
trigger: 'hover',
|
||||
placement: 'right',
|
||||
content: function () {
|
||||
return '<div class="history-thumbnail" style="background-image: url(' + $(this).data('img') + '); height: ' + $(this).data('height') + 'px;" />';
|
||||
}
|
||||
});
|
||||
|
||||
media_info_table.rows().every(function () {
|
||||
var rowData = this.data();
|
||||
if (rowData['rating_key'] in media_info_child_table) {
|
||||
// if a child table was already created
|
||||
$(this.node()).find('i.fa.fa-plus-circle').toggleClass('fa-plus-circle').toggleClass('fa-minus-circle');
|
||||
this.child(childTableFormatMedia(rowData)).show();
|
||||
createChildTableMedia(this, rowData)
|
||||
}
|
||||
});
|
||||
},
|
||||
"preDrawCallback": function(settings) {
|
||||
var msg = "<i class='fa fa-refresh fa-spin'></i> Fetching rows...";
|
||||
showMsg(msg, false, false, 0)
|
||||
},
|
||||
"rowCallback": function (row, rowData, rowIndex) {
|
||||
if (rowData['rating_key'] in media_info_child_table) {
|
||||
// if a child table was already created
|
||||
$(row).addClass('shown')
|
||||
media_info_table.row(row).child(childTableFormatMedia(rowData)).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Parent table expand detailed media info
|
||||
$('#media_info_table').on('click', '> tbody > tr > td.expand-media-info a', function () {
|
||||
var tr = $(this).closest('tr');
|
||||
var row = media_info_table.row(tr);
|
||||
var rowData = row.data();
|
||||
|
||||
$(this).find('i.fa').toggleClass('fa-plus-circle').toggleClass('fa-minus-circle');
|
||||
|
||||
if (row.child.isShown()) {
|
||||
$('div.slider', row.child()).slideUp(function () {
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
delete media_info_child_table[rowData['rating_key']];
|
||||
});
|
||||
} else {
|
||||
tr.addClass('shown');
|
||||
row.child(childTableFormatMedia(rowData)).show();
|
||||
createChildTableMedia(row, rowData);
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize the detailed media info child table options using the parent table options
|
||||
function childTableOptionsMedia(rowData) {
|
||||
switch (rowData['section_type']) {
|
||||
case 'show':
|
||||
section_type = 'season';
|
||||
break;
|
||||
case 'season':
|
||||
section_type = 'episode';
|
||||
break;
|
||||
case 'artist':
|
||||
section_type = 'album';
|
||||
break;
|
||||
case 'album':
|
||||
section_type = 'track';
|
||||
break;
|
||||
}
|
||||
|
||||
media_info_table_options = media_info_table_options;
|
||||
// Remove settings that are not necessary
|
||||
media_info_table_options.searching = false;
|
||||
media_info_table_options.lengthChange = false;
|
||||
media_info_table_options.info = false;
|
||||
media_info_table_options.pageLength = 10;
|
||||
media_info_table_options.bStateSave = false;
|
||||
media_info_table_options.ajax = {
|
||||
url: 'get_library_media_info2',
|
||||
type: 'post',
|
||||
data: function (d) {
|
||||
return {
|
||||
json_data: JSON.stringify(d),
|
||||
section_id: rowData['section_id'],
|
||||
section_type: section_type,
|
||||
rating_key: rowData['rating_key']
|
||||
};
|
||||
}
|
||||
}
|
||||
media_info_table_options.fnDrawCallback = function (settings) {
|
||||
$('#ajaxMsg').fadeOut();
|
||||
|
||||
// Create the tooltips.
|
||||
$('.expand-media-info-tooltip').tooltip({ container: 'body' });
|
||||
$('.media-type-tooltip').tooltip();
|
||||
$('.thumb-tooltip').popover({
|
||||
html: true,
|
||||
trigger: 'hover',
|
||||
placement: 'right',
|
||||
content: function () {
|
||||
return '<div class="history-thumbnail" style="background-image: url(' + $(this).data('img') + '); height: ' + $(this).data('height') + 'px;" />';
|
||||
}
|
||||
});
|
||||
|
||||
if (rowData['rating_key'] in media_info_child_table) {
|
||||
media_info_child_table[rowData['rating_key']].rows().every(function () {
|
||||
var childrowData = this.data();
|
||||
if (childrowData['rating_key'] in media_info_child_table) {
|
||||
// if a child table was already created
|
||||
$(this.node()).find('i.fa.fa-plus-circle').toggleClass('fa-plus-circle').toggleClass('fa-minus-circle');
|
||||
this.child(childTableFormatMedia(childrowData)).show();
|
||||
createChildTableMedia(this, childrowData)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(this).closest('div.slider').slideDown();
|
||||
}
|
||||
media_info_table_options.fnRowCallback = function (row, rowData, rowIndex) {
|
||||
if (rowData['rating_key'] in media_info_child_table) {
|
||||
// if a child table was already created
|
||||
$(row).addClass('shown')
|
||||
media_info_table.row(row).child(childTableFormatMedia(rowData)).show();
|
||||
}
|
||||
}
|
||||
|
||||
return media_info_table_options;
|
||||
}
|
||||
|
||||
// Format the detailed media info child table
|
||||
function childTableFormatMedia(rowData) {
|
||||
return '<div class="slider">' +
|
||||
'<table id="media_info_child-' + rowData['rating_key'] + '" data-id="' + rowData['rating_key'] + '" width="100%">' +
|
||||
'<thead>' +
|
||||
'<tr>' +
|
||||
'<th align="left" id="added_at">Added At</th>' +
|
||||
'<th align="left" id="title">Title</th>' +
|
||||
'<th align="left" id="container">Container</th>' +
|
||||
'<th align="left" id="bitrate">Bitrate</th>' +
|
||||
'<th align="left" id="video_codec">Video Codec</th>' +
|
||||
'<th align="left" id="video_resolution">Video Resolution</th>' +
|
||||
'<th align="left" id="video_resolution">Video Framerate</th>' +
|
||||
'<th align="left" id="audio_codec">Audio Codec</th>' +
|
||||
'<th align="left" id="audio_channels">Audio Channels</th>' +
|
||||
'<th align="left" id="file_size">File Size</th>' +
|
||||
'<th align="left" id="last_watched">Last Watched</th>' +
|
||||
'<th align="left" id="total_plays">Total Plays</th>' +
|
||||
'</tr>' +
|
||||
'</thead>' +
|
||||
'<tbody>' +
|
||||
'</tbody>' +
|
||||
'</table>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
// Create the detailed media info child table
|
||||
media_info_child_table = {};
|
||||
function createChildTableMedia(row, rowData) {
|
||||
media_info_table_options = childTableOptionsMedia(rowData);
|
||||
// initialize the child table
|
||||
media_info_child_table[rowData['rating_key']] = $('#media_info_child-' + rowData['rating_key']).DataTable(media_info_table_options);
|
||||
|
||||
// Set child table column visibility to match parent table
|
||||
var visibility = media_info_table.columns().visible();
|
||||
for (var i = 0; i < visibility.length; i++) {
|
||||
if (!(visibility[i])) { media_info_child_table[rowData['rating_key']].column(i).visible(visibility[i]); }
|
||||
}
|
||||
media_info_table.on('column-visibility', function (e, settings, colIdx, visibility) {
|
||||
if (row.child.isShown()) {
|
||||
media_info_child_table[rowData['rating_key']].column(colIdx).visible(visibility);
|
||||
}
|
||||
});
|
||||
|
||||
// Child table expand detailed media info
|
||||
$('table[id^=media_info_child]').on('click', '> tbody > tr > td.expand-media-info a', function () {
|
||||
var table_id = $(this).closest('table').data('id');
|
||||
var tr = $(this).closest('tr');
|
||||
var row = media_info_child_table[table_id].row(tr);
|
||||
var rowData = row.data();
|
||||
|
||||
$(this).find('i.fa').toggleClass('fa-plus-circle').toggleClass('fa-minus-circle');
|
||||
|
||||
if (row.child.isShown()) {
|
||||
$('div.slider', row.child()).slideUp(function () {
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
delete media_info_child_table[rowData['rating_key']];
|
||||
});
|
||||
} else {
|
||||
tr.addClass('shown');
|
||||
row.child(childTableFormatMedia(rowData)).show();
|
||||
createChildTableMedia(row, rowData);
|
||||
}
|
||||
});
|
||||
}
|
|
@ -4,7 +4,7 @@ var plex_log_table_options = {
|
|||
"serverSide": false,
|
||||
"pagingType": "bootstrap",
|
||||
"order": [ 0, 'desc'],
|
||||
"pageLength": 10,
|
||||
"pageLength": 50,
|
||||
"stateSave": true,
|
||||
"language": {
|
||||
"search":"Search: ",
|
||||
|
|
|
@ -54,13 +54,13 @@ users_list_table_options = {
|
|||
"targets": [2],
|
||||
"data": "friendly_name",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== '') {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html('<div class="edit-user-name" data-id="' + rowData['user_id'] + '">' +
|
||||
'<a href="user?user_id=' + rowData['user_id'] + '">' + cellData + '</a>' +
|
||||
'<input type="text" class="hidden" value="' + cellData + '">' +
|
||||
'</div>');
|
||||
} else {
|
||||
$(td).html(cellData);
|
||||
$(td).html('n/a');
|
||||
}
|
||||
},
|
||||
"width": "10%",
|
||||
|
@ -69,11 +69,11 @@ users_list_table_options = {
|
|||
{
|
||||
"targets": [3],
|
||||
"data": "last_seen",
|
||||
"render": function ( data, type, full ) {
|
||||
if (data) {
|
||||
return moment(data, "X").fromNow();
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(moment(cellData, "X").fromNow());
|
||||
} else {
|
||||
return "never";
|
||||
$(td).html("never");
|
||||
}
|
||||
},
|
||||
"searchable": false,
|
||||
|
@ -105,7 +105,7 @@ users_list_table_options = {
|
|||
"targets": [5],
|
||||
"data": "platform",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== '') {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
$(td).html(cellData);
|
||||
} else {
|
||||
$(td).html('n/a');
|
||||
|
@ -118,7 +118,7 @@ users_list_table_options = {
|
|||
"targets": [6],
|
||||
"data":"player",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData) {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
var transcode_dec = '';
|
||||
if (rowData['video_decision'] === 'transcode') {
|
||||
transcode_dec = '<span class="transcode-tooltip" data-toggle="tooltip" title="Transcode"><i class="fa fa-server fa-fw"></i></span>';
|
||||
|
@ -139,7 +139,7 @@ users_list_table_options = {
|
|||
"targets": [7],
|
||||
"data":"last_watched",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== '') {
|
||||
if (cellData !== null && cellData !== '') {
|
||||
var media_type = '';
|
||||
var thumb_popover = ''
|
||||
if (rowData['media_type'] === 'movie') {
|
||||
|
@ -156,9 +156,9 @@ users_list_table_options = {
|
|||
$(td).html('<div class="history-title"><a href="info?source=history&rating_key=' + rowData['rating_key'] + '"><div style="float: left;">' + media_type + ' ' + thumb_popover + '</div></a></div>');
|
||||
} else if (rowData['media_type']) {
|
||||
$(td).html('<a href="info?rating_key=' + rowData['rating_key'] + '">' + cellData + '</a>');
|
||||
} else {
|
||||
$(td).html('n/a');
|
||||
}
|
||||
} else {
|
||||
$(td).html('n/a');
|
||||
}
|
||||
},
|
||||
"width": "30%",
|
||||
|
|
|
@ -7,6 +7,17 @@
|
|||
|
||||
<%def name="body()">
|
||||
<div class='container-fluid'>
|
||||
% if config['update_section_ids'] == 1:
|
||||
<div id="update_section_ids_mssage" style="text-align: center; margin-top: 20px;">
|
||||
<i class="fa fa-exclamation-triangle"></i> PlexPy needs to update the Library IDs in your databse. Click the "<strong>Refresh libraries</strong>" button below to begin the update.
|
||||
</div>
|
||||
% elif config['update_section_ids'] == -1:
|
||||
<div id="update_section_ids_mssage" style="text-align: center; margin-top: 20px;">
|
||||
<i class="fa fa-refresh fa-spin"></i> PlexPy is updating library IDs in the database. This could take a few minutes depending on the size of your database.
|
||||
<br />
|
||||
You may leave this page and come back later.
|
||||
</div>
|
||||
% endif
|
||||
<div class='table-card-header'>
|
||||
<div class="header-bar">
|
||||
<span><i class="fa fa-book"></i> All Libraries</span>
|
||||
|
@ -20,7 +31,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class='table-card-back'>
|
||||
<table id="libraries_list_table" class="display" width="100%">
|
||||
<table id="libraries_list_table" class="display no-fixed" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left" id="edit_row">Edit</th>
|
||||
|
@ -74,7 +85,9 @@
|
|||
url: 'get_library_list',
|
||||
type: 'POST',
|
||||
data: function ( d ) {
|
||||
return { 'json_data': JSON.stringify( d ) };
|
||||
return {
|
||||
json_data: JSON.stringify(d)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,7 +170,15 @@
|
|||
});
|
||||
});
|
||||
|
||||
$("#refresh-libraries-list").click(function() {
|
||||
$("#refresh-libraries-list").click(function () {
|
||||
if ("${config['update_section_ids']}" == "1") {
|
||||
$('#update_section_ids_mssage').html(
|
||||
'<i class="fa fa-refresh fa-spin"></i> PlexPy is updating library IDs in the database. This could take a few minutes depending on the size of your database.' +
|
||||
'<br />' +
|
||||
'You may leave this page and come back later.');
|
||||
$(this).prop('disabled', true);
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: 'refresh_libraries_list',
|
||||
cache: false,
|
||||
|
@ -173,5 +194,9 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
if ("${config['update_section_ids']}" == "-1") {
|
||||
$("#refresh-libraries-list").prop('disabled', true);
|
||||
}
|
||||
</script>
|
||||
</%def>
|
|
@ -67,6 +67,7 @@ DOCUMENTATION :: END
|
|||
<ul class="user-info-nav">
|
||||
<li class="active"><a href="#profile" data-toggle="tab">Profile</a></li>
|
||||
<li><a id="history-tab-btn" href="#libraryHistory" data-toggle="tab">History</a></li>
|
||||
<li><a id="media-info-tab-btn" href="#libraryMediaInfo" data-toggle="tab">Media Info</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -170,18 +171,62 @@ DOCUMENTATION :: END
|
|||
<table class="display" id="history_table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align='left' id="delete">Delete</th>
|
||||
<th align='left' id="time">Time</th>
|
||||
<th align='left' id="friendly_name">User</th>
|
||||
<th align='left' id="ip_address">IP Address</th>
|
||||
<th align='left' id="platform">Platform</th>
|
||||
<th align='left' id="player">Player</th>
|
||||
<th align='left' id="title">Title</th>
|
||||
<th align='left' id="started">Started</th>
|
||||
<th align='left' id="paused_counter">Paused</th>
|
||||
<th align='left' id="stopped">Stopped</th>
|
||||
<th align='left' id="duration">Duration</th>
|
||||
<th align='left' id="percent_complete"></th>
|
||||
<th align="left" id="delete">Delete</th>
|
||||
<th align="left" id="time">Time</th>
|
||||
<th align="left" id="friendly_name">User</th>
|
||||
<th align="left" id="ip_address">IP Address</th>
|
||||
<th align="left" id="platform">Platform</th>
|
||||
<th align="left" id="player">Player</th>
|
||||
<th align="left" id="title">Title</th>
|
||||
<th align="left" id="started">Started</th>
|
||||
<th align="left" id="paused_counter">Paused</th>
|
||||
<th align="left" id="stopped">Stopped</th>
|
||||
<th align="left" id="duration">Duration</th>
|
||||
<th align="left" id="percent_complete"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="libraryMediaInfo">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class='table-card-header'>
|
||||
<div class="header-bar">
|
||||
<span>
|
||||
<i class="fa fa-history"></i> All Media Info for <strong>
|
||||
<span class="set-username">${data['section_name']}</span>
|
||||
</strong>
|
||||
</span>
|
||||
</div>
|
||||
<div class="button-bar">
|
||||
<button class="btn btn-dark refresh-media-info-table-button" id="refresh-media-info-table" style="margin-right: 5px;">
|
||||
<i class="fa fa-refresh"></i> Refresh media info
|
||||
</button>
|
||||
<div class="colvis-button-bar hidden-xs" id="button-bar-media-info"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-card-back">
|
||||
<table class="display" id="media_info_table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left" id="added_at">Added At</th>
|
||||
<th align="left" id="title">Title</th>
|
||||
<th align="left" id="container">Container</th>
|
||||
<th align="left" id="bitrate">Bitrate</th>
|
||||
<th align="left" id="video_codec">Video Codec</th>
|
||||
<th align="left" id="video_resolution">Video Resolution</th>
|
||||
<th align="left" id="video_resolution">Video Framerate</th>
|
||||
<th align="left" id="audio_codec">Audio Codec</th>
|
||||
<th align="left" id="audio_channels">Audio Channels</th>
|
||||
<th align="left" id="file_size">File Size</th>
|
||||
<th align="left" id="last_watched">Last Watched</th>
|
||||
<th align="left" id="total_plays">Total Plays</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
|
@ -250,6 +295,7 @@ DOCUMENTATION :: END
|
|||
% if data:
|
||||
<script src="interfaces/default/js/moment-with-locale.js"></script>
|
||||
<script src="interfaces/default/js/tables/history_table.js"></script>
|
||||
<script src="interfaces/default/js/tables/media_info_table.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
|
@ -267,7 +313,7 @@ DOCUMENTATION :: END
|
|||
$.ajax({
|
||||
url: 'get_library_watch_time_stats',
|
||||
async: true,
|
||||
data: { library_id: section_id },
|
||||
data: { section_id: section_id },
|
||||
complete: function(xhr, status) {
|
||||
$("#library-time-stats").html(xhr.responseText);
|
||||
}
|
||||
|
@ -277,7 +323,7 @@ DOCUMENTATION :: END
|
|||
$.ajax({
|
||||
url: 'get_library_user_stats',
|
||||
async: true,
|
||||
data: { library_id: section_id },
|
||||
data: { section_id: section_id },
|
||||
complete: function(xhr, status) {
|
||||
$("#library-user-stats").html(xhr.responseText);
|
||||
}
|
||||
|
@ -290,8 +336,8 @@ DOCUMENTATION :: END
|
|||
type: 'post',
|
||||
data: function ( d ) {
|
||||
return {
|
||||
'json_data': JSON.stringify( d ),
|
||||
'section_id': section_id
|
||||
json_data: JSON.stringify( d ),
|
||||
section_id: section_id
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -304,9 +350,44 @@ DOCUMENTATION :: END
|
|||
clearSearchButton('history_table', history_table);
|
||||
}
|
||||
|
||||
function loadMediaInfoTable() {
|
||||
// Build media info table
|
||||
media_info_table_options.ajax = {
|
||||
url: 'get_library_media_info2',
|
||||
type: 'post',
|
||||
data: function ( d ) {
|
||||
return {
|
||||
json_data: JSON.stringify( d ),
|
||||
section_id: section_id
|
||||
};
|
||||
}
|
||||
}
|
||||
media_info_table = $('#media_info_table').DataTable(media_info_table_options);
|
||||
|
||||
var colvis = new $.fn.dataTable.ColVis(media_info_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark' });
|
||||
$(colvis.button()).appendTo('#button-bar-media-info');
|
||||
|
||||
clearSearchButton('media_info_table', media_info_table);
|
||||
}
|
||||
|
||||
$( "#history-tab-btn" ).one( "click", function() {
|
||||
loadHistoryTable();
|
||||
});
|
||||
$( "#media-info-tab-btn" ).one( "click", function() {
|
||||
loadMediaInfoTable();
|
||||
});
|
||||
|
||||
$("#refresh-media-info-table").click(function () {
|
||||
$.ajax({
|
||||
url: 'delete_datatable_media_info_cache',
|
||||
cache: false,
|
||||
async: true,
|
||||
data: { section_id: section_id },
|
||||
complete: function(xhr, status) {
|
||||
media_info_table.draw()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Load edit library modal
|
||||
$("#toggle-edit-library-modal").click(function() {
|
||||
|
@ -374,7 +455,7 @@ DOCUMENTATION :: END
|
|||
url: 'get_library_recently_watched',
|
||||
async: true,
|
||||
data: {
|
||||
library_id: section_id,
|
||||
section_id: section_id,
|
||||
limit: containerSize
|
||||
},
|
||||
complete: function(xhr, status) {
|
||||
|
@ -398,7 +479,7 @@ DOCUMENTATION :: END
|
|||
url: 'get_library_recently_added',
|
||||
async: true,
|
||||
data: {
|
||||
library_id: section_id,
|
||||
section_id: section_id,
|
||||
limit: containerSize
|
||||
},
|
||||
complete: function(xhr, status) {
|
||||
|
@ -413,8 +494,9 @@ DOCUMENTATION :: END
|
|||
recentlyWatched();
|
||||
recentlyAdded();
|
||||
});
|
||||
|
||||
$('div.art-face').animate({ opacity: 0.2 }, { duration: 1000 });
|
||||
});
|
||||
$('div.art-face').animate({ opacity: 0.2 }, { duration: 1000 });
|
||||
</script>
|
||||
% endif
|
||||
</%def>
|
|
@ -19,7 +19,7 @@ parent_title Returns the name of the artist.
|
|||
grandparent_title Returns the name of the show.
|
||||
media_index Returns the index number of the episode.
|
||||
parent_media_index Returns the index number of the season.
|
||||
library_id Returns the library section number of the media item.
|
||||
section_id Returns the library section number of the media item.
|
||||
library_name Returns the library section name of the media item.
|
||||
year Returns the release year of the movie, episode, or album.
|
||||
thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
||||
|
@ -39,7 +39,11 @@ DOCUMENTATION :: END
|
|||
<a href="info?rating_key=${item['rating_key']}">
|
||||
<div class="dashboard-recent-media-poster">
|
||||
% if item['media_type'] == 'episode':
|
||||
% if item['parent_thumb']:
|
||||
<div class="dashboard-recent-media-poster-face" style="background-image: url(pms_image_proxy?img=${item['parent_thumb']}&width=300&height=450&fallback=poster);">
|
||||
% else:
|
||||
<div class="dashboard-recent-media-poster-face" style="background-image: url(pms_image_proxy?img=${item['grandparent_thumb']}&width=300&height=450&fallback=poster);">
|
||||
% endif
|
||||
% elif item['media_type'] == 'movie':
|
||||
<div class="dashboard-recent-media-poster-face" style="background-image: url(pms_image_proxy?img=${item['thumb']}&width=300&height=450&fallback=poster);">
|
||||
% endif
|
||||
|
|
|
@ -19,7 +19,7 @@ parent_title Returns the name of the artist.
|
|||
grandparent_title Returns the name of the show.
|
||||
media_index Returns the index number of the episode.
|
||||
parent_media_index Returns the index number of the season.
|
||||
library_id Returns the library section number of the media item.
|
||||
section_id Returns the library section number of the media item.
|
||||
library_name Returns the library section name of the media item.
|
||||
year Returns the release year of the movie, episode, or album.
|
||||
thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
||||
|
|
|
@ -181,18 +181,18 @@ from plexpy import helpers
|
|||
<table class="display" id="history_table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align='left' id="delete">Delete</th>
|
||||
<th align='left' id="time">Time</th>
|
||||
<th align='left' id="friendly_name">User</th>
|
||||
<th align='left' id="ip_address">IP Address</th>
|
||||
<th align='left' id="platform">Platform</th>
|
||||
<th align='left' id="player">Player</th>
|
||||
<th align='left' id="title">Title</th>
|
||||
<th align='left' id="started">Started</th>
|
||||
<th align='left' id="paused_counter">Paused</th>
|
||||
<th align='left' id="stopped">Stopped</th>
|
||||
<th align='left' id="duration">Duration</th>
|
||||
<th align='left' id="percent_complete"></th>
|
||||
<th align="left" id="delete">Delete</th>
|
||||
<th align="left" id="time">Time</th>
|
||||
<th align="left" id="friendly_name">User</th>
|
||||
<th align="left" id="ip_address">IP Address</th>
|
||||
<th align="left" id="platform">Platform</th>
|
||||
<th align="left" id="player">Player</th>
|
||||
<th align="left" id="title">Title</th>
|
||||
<th align="left" id="started">Started</th>
|
||||
<th align="left" id="paused_counter">Paused</th>
|
||||
<th align="left" id="stopped">Stopped</th>
|
||||
<th align="left" id="duration">Duration</th>
|
||||
<th align="left" id="percent_complete"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
|
@ -221,17 +221,17 @@ from plexpy import helpers
|
|||
<table class="display" id="sync_table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align='left' id="state">State</th>
|
||||
<th align='left' id="username">Username</th>
|
||||
<th align='left' id="sync_title">Title</th>
|
||||
<th align='left' id="type">Type</th>
|
||||
<th align='left' id="sync_platform">Platform</th>
|
||||
<th align='left' id="device">Device</th>
|
||||
<th align='left' id="size">Total Size</th>
|
||||
<th align='left' id="items">Total Items</th>
|
||||
<th align='left' id="converted">Converted</th>
|
||||
<th align='left' id="downloaded">Downloaded</th>
|
||||
<th align='left' id="sync_percent_complete">Complete</th>
|
||||
<th align="left" id="state">State</th>
|
||||
<th align="left" id="username">Username</th>
|
||||
<th align="left" id="sync_title">Title</th>
|
||||
<th align="left" id="type">Type</th>
|
||||
<th align="left" id="sync_platform">Platform</th>
|
||||
<th align="left" id="device">Device</th>
|
||||
<th align="left" id="size">Total Size</th>
|
||||
<th align="left" id="items">Total Items</th>
|
||||
<th align="left" id="converted">Converted</th>
|
||||
<th align="left" id="downloaded">Downloaded</th>
|
||||
<th align="left" id="sync_percent_complete">Complete</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
|
@ -342,9 +342,9 @@ from plexpy import helpers
|
|||
type: 'post',
|
||||
data: function ( d ) {
|
||||
return {
|
||||
'json_data': JSON.stringify( d ),
|
||||
'user_id': user_id,
|
||||
'media_type': media_type
|
||||
json_data: JSON.stringify( d ),
|
||||
user_id: user_id,
|
||||
media_type: media_type
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -391,8 +391,9 @@ from plexpy import helpers
|
|||
url: 'get_user_ips',
|
||||
type: 'post',
|
||||
data: function ( d ) {
|
||||
return { 'json_data': JSON.stringify( d ),
|
||||
'user_id': user_id
|
||||
return {
|
||||
json_data: JSON.stringify( d ),
|
||||
user_id: user_id
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class='table-card-back'>
|
||||
<table id="users_list_table" class="display" width="100%">
|
||||
<table id="users_list_table" class="display no-fixed" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left" id="edit_row">Edit</th>
|
||||
|
@ -77,7 +77,9 @@
|
|||
url: 'get_user_list',
|
||||
type: 'POST',
|
||||
data: function ( d ) {
|
||||
return { 'json_data': JSON.stringify( d ) };
|
||||
return {
|
||||
json_data: JSON.stringify(d)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue