diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 6c683f76..c271be54 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -2180,6 +2180,10 @@ a .home-platforms-instance-list-oval:hover, .refresh-libraries-button { float: right; } +.refresh-users-button, +.refresh-libraries-button { + margin-right: 5px; +} .nav-settings, .nav-settings ul { margin: 0px 0px 20px 0px; diff --git a/data/interfaces/default/js/script.js b/data/interfaces/default/js/script.js index 5d82f90c..1c416319 100644 --- a/data/interfaces/default/js/script.js +++ b/data/interfaces/default/js/script.js @@ -252,13 +252,13 @@ function isPrivateIP(ip_address) { function humanTime(seconds) { if (seconds >= 86400) { - text = '
days
hrs
mins
'; + text = 'days
' + + 'hrs
' + + 'mins
'; return text; } else if (seconds >= 3600) { - text = 'hrs
mins
'; + text = 'hrs
' + + 'mins
'; return text; } else if (seconds >= 60) { text = 'mins
'; @@ -269,6 +269,25 @@ function humanTime(seconds) { } } +function humanTimeClean(seconds) { + if (seconds >= 86400) { + text = Math.floor(moment.duration(seconds, 'seconds').asDays()) + ' days ' + + Math.floor(moment.duration((seconds % 86400), 'seconds').asHours()) + ' hrs ' + + Math.floor(moment.duration(((seconds % 86400) % 3600), 'seconds').asMinutes()) + ' mins'; + return text; + } else if (seconds >= 3600) { + text = Math.floor(moment.duration((seconds % 86400), 'seconds').asHours()) + ' hrs ' + + Math.floor(moment.duration(((seconds % 86400) % 3600), 'seconds').asMinutes()) + ' mins'; + return text; + } else if (seconds >= 60) { + text = Math.floor(moment.duration(((seconds % 86400) % 3600), 'seconds').asMinutes()) + ' mins'; + return text; + } else { + text = '0'; + return text; + } +} + String.prototype.toProperCase = function () { return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); }; diff --git a/data/interfaces/default/js/tables/libraries.js b/data/interfaces/default/js/tables/libraries.js index 377295ae..46844506 100644 --- a/data/interfaces/default/js/tables/libraries.js +++ b/data/interfaces/default/js/tables/libraries.js @@ -161,12 +161,28 @@ libraries_list_table_options = { $(td).html('n/a'); } }, - "width": "25%", + "width": "18%", "className": "hidden-sm hidden-xs" }, { "targets": [9], "data": "plays", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== null && cellData !== '') { + $(td).html(cellData); + } + }, + "searchable": false, + "width": "7%" + }, + { + "targets": [10], + "data": "duration", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== null && cellData !== '') { + $(td).html(humanTimeClean(cellData)); + } + }, "searchable": false, "width": "10%" } diff --git a/data/interfaces/default/js/tables/users.js b/data/interfaces/default/js/tables/users.js index f7147a17..d1abb6c9 100644 --- a/data/interfaces/default/js/tables/users.js +++ b/data/interfaces/default/js/tables/users.js @@ -165,12 +165,28 @@ users_list_table_options = { $(td).html('n/a'); } }, - "width": "30%", + "width": "23%", "className": "hidden-sm hidden-xs" }, { "targets": [8], "data": "plays", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== null && cellData !== '') { + $(td).html(cellData); + } + }, + "searchable": false, + "width": "7%" + }, + { + "targets": [9], + "data": "duration", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== null && cellData !== '') { + $(td).html(humanTimeClean(cellData)); + } + }, "searchable": false, "width": "10%" } diff --git a/data/interfaces/default/libraries.html b/data/interfaces/default/libraries.html index 1e99697c..41fc9825 100644 --- a/data/interfaces/default/libraries.html +++ b/data/interfaces/default/libraries.html @@ -2,6 +2,7 @@ <%def name="headIncludes()"> + %def> @@ -23,6 +24,7 @@ All Libraries