diff --git a/data/interfaces/default/history.html b/data/interfaces/default/history.html index c74baafe..e374fd1a 100644 --- a/data/interfaces/default/history.html +++ b/data/interfaces/default/history.html @@ -60,7 +60,8 @@ User IP Address Platform - Player + Product + Player Title Started Paused @@ -143,7 +144,7 @@ var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', - exclude: [0, 11] + exclude: [0, 12] }); $(colvis.button()).appendTo('div.colvis-button-bar'); diff --git a/data/interfaces/default/history_table_modal.html b/data/interfaces/default/history_table_modal.html index 7db1a0eb..15c18121 100644 --- a/data/interfaces/default/history_table_modal.html +++ b/data/interfaces/default/history_table_modal.html @@ -26,6 +26,7 @@ User IP Address Platform + Product Player Title Started @@ -61,7 +62,7 @@ }; history_table = $('#history_table_modal').DataTable(history_table_options); - history_table.columns([0, 3, 4, 8, 10, 11]).visible(false); + history_table.columns([0, 3, 4, 5, 9, 11, 12]).visible(false); clearSearchButton('history_table_modal', history_table); diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index d23bac32..074a5843 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -451,6 +451,7 @@ DOCUMENTATION :: END User IP Address Platform + Product Player Title Started @@ -613,7 +614,7 @@ DOCUMENTATION :: END $(document).ready(function () { get_history(); history_table = $('#history_table-RK-${data["rating_key"]}').DataTable(history_table_options); - var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [0, 11] }); + var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [0, 12] }); $(colvis.button()).appendTo('div.colvis-button-bar'); clearSearchButton('history_table-RK-${data["rating_key"]}', history_table); diff --git a/data/interfaces/default/js/tables/history_table.js b/data/interfaces/default/js/tables/history_table.js index f46f7cfd..b605cdd2 100644 --- a/data/interfaces/default/js/tables/history_table.js +++ b/data/interfaces/default/js/tables/history_table.js @@ -49,7 +49,7 @@ history_table_options = { }, { "targets": [1], - "data":"date", + "data": "date", "createdCell": function (td, cellData, rowData, row, col) { var date = moment(cellData, "X").format(date_format); if (rowData['state'] !== null) { @@ -77,7 +77,7 @@ history_table_options = { }, { "targets": [2], - "data":"friendly_name", + "data": "friendly_name", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { if (rowData['user_id']) { @@ -112,7 +112,18 @@ history_table_options = { }, { "targets": [4], - "data":"platform", + "data": "platform", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== '') { + $(td).html(capitalizeFirstLetter(cellData)); + } + }, + "width": "10%", + "className": "no-wrap" + }, + { + "targets": [5], + "data": "product", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { $(td).html(cellData); @@ -122,7 +133,7 @@ history_table_options = { "className": "no-wrap" }, { - "targets": [5], + "targets": [6], "data": "player", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { @@ -137,12 +148,12 @@ history_table_options = { $(td).html('
' + transcode_dec + ' ' + cellData + '
'); } }, - "width": "12%", + "width": "10%", "className": "no-wrap modal-control" }, { - "targets": [6], - "data":"full_title", + "targets": [7], + "data": "full_title", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { var parent_info = ''; @@ -171,12 +182,12 @@ history_table_options = { } } }, - "width": "33%", + "width": "25%", "className": "datatable-wrap" }, { - "targets": [7], - "data":"started", + "targets": [8], + "data": "started", "createdCell": function (td, cellData, rowData, row, col) { if (cellData === null) { $(td).html('n/a'); @@ -189,8 +200,8 @@ history_table_options = { "className": "no-wrap" }, { - "targets": [8], - "data":"paused_counter", + "targets": [9], + "data": "paused_counter", "render": function (data, type, full) { if (data !== null) { return Math.round(moment.duration(data, 'seconds').as('minutes')) + ' mins'; @@ -203,8 +214,8 @@ history_table_options = { "className": "no-wrap" }, { - "targets": [9], - "data":"stopped", + "targets": [10], + "data": "stopped", "createdCell": function (td, cellData, rowData, row, col) { if (cellData === null || (rowData['state'] != null && rowData['state'] != "stopped")) { $(td).html('n/a'); @@ -217,8 +228,8 @@ history_table_options = { "className": "no-wrap" }, { - "targets": [10], - "data":"duration", + "targets": [11], + "data": "duration", "render": function (data, type, full) { if (data !== null) { return Math.round(moment.duration(data, 'seconds').as('minutes')) + ' mins'; @@ -231,7 +242,7 @@ history_table_options = { "className": "no-wrap" }, { - "targets": [11], + "targets": [12], "data": "watched_status", "createdCell": function (td, cellData, rowData, row, col) { if (cellData == 1) { @@ -489,7 +500,8 @@ function childTableFormat(rowData) { 'User' + 'IP Address' + 'Platform' + - 'Player' + + 'Product' + + 'Player' + 'Title' + 'Started' + 'Paused' + diff --git a/data/interfaces/default/library.html b/data/interfaces/default/library.html index 1382d991..38d519f1 100644 --- a/data/interfaces/default/library.html +++ b/data/interfaces/default/library.html @@ -205,6 +205,7 @@ DOCUMENTATION :: END User IP Address Platform + Product Player Title Started @@ -385,7 +386,7 @@ DOCUMENTATION :: END }; history_table = $('#history_table-SID-${data["section_id"]}').DataTable(history_table_options); - var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [0, 11] }); + var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [0, 12] }); $(colvis.button()).appendTo('#button-bar-history'); clearSearchButton('history_table-SID-${data["section_id"]}', history_table); diff --git a/data/interfaces/default/user.html b/data/interfaces/default/user.html index 66a36ef1..1aef0994 100644 --- a/data/interfaces/default/user.html +++ b/data/interfaces/default/user.html @@ -184,6 +184,7 @@ DOCUMENTATION :: END User IP Address Platform + Product Player Title Started @@ -425,7 +426,7 @@ DOCUMENTATION :: END history_table = $('#history_table-UID-${data["user_id"]}').DataTable(history_table_options); history_table.column(2).visible(false); - var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [0, 11] }); + var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark', exclude: [0, 12] }); $(colvis.button()).appendTo('#button-bar-history'); clearSearchButton('history_table-UID-${data["user_id"]}', history_table); diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index c5390f27..750607e0 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -76,6 +76,7 @@ class DataFactory(object): '(CASE WHEN users.friendly_name IS NULL OR TRIM(users.friendly_name) = "" \ THEN users.username ELSE users.friendly_name END) AS friendly_name', 'platform', + 'product', 'player', 'ip_address', 'session_history.media_type', @@ -123,6 +124,7 @@ class DataFactory(object): '(CASE WHEN friendly_name IS NULL OR TRIM(friendly_name) = "" \ THEN user ELSE friendly_name END) AS friendly_name', 'platform', + 'product', 'player', 'ip_address', 'media_type', @@ -225,6 +227,7 @@ class DataFactory(object): 'user': item['user'], 'friendly_name': item['friendly_name'], 'platform': platform, + 'product': item['product'], 'player': item['player'], 'ip_address': item['ip_address'], 'media_type': item['media_type'],