From ac9a8b85ec419b5ef3cd21eaa9bee850f4cce36d Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 22 Aug 2015 22:11:47 +0200 Subject: [PATCH 01/26] Fix stream_duration if no paused_duration and format correctly. --- plexpy/notification_handler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 0429bb30..6e594306 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -300,7 +300,11 @@ def build_notify_text(session, state): duration = helpers.convert_milliseconds_to_minutes(item_metadata['duration']) view_offset = helpers.convert_milliseconds_to_minutes(session['view_offset']) - stream_duration = 0 if state == 'play' else int((time.time() - helpers.cast_to_float(session['started']) - helpers.cast_to_float(session['paused_counter'])) / 60) + if session['paused_counter']: + stream_duration = int((time.time() - helpers.cast_to_float(session['started']) - + helpers.cast_to_float(session['paused_counter'])) / 60) + else: + stream_duration = int((time.time() - helpers.cast_to_float(session['started'])) / 60) progress_percent = helpers.get_percent(view_offset, duration) From ac3bafcd02de1f1b20e4a096485b3f72230b49f8 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 22 Aug 2015 23:57:17 +0200 Subject: [PATCH 02/26] Fix stream_duration when notify state is play. --- plexpy/notification_handler.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 6e594306..5330b7e5 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -162,6 +162,7 @@ def notify(stream_data=None, notify_action=None): else: logger.debug(u"PlexPy Notifier :: Notify called but incomplete data received.") + def get_notify_state(session): monitor_db = database.MonitorDatabase() result = monitor_db.select('SELECT on_play, on_stop, on_pause, on_resume, on_buffer, on_watched, agent_id ' @@ -184,6 +185,7 @@ def get_notify_state(session): return notify_states + def set_notify_state(session, state, agent_info): if session and state and agent_info: @@ -215,6 +217,7 @@ def set_notify_state(session, state, agent_info): else: logger.error('PlexPy Notifier :: Unable to set notify state.') + def build_notify_text(session, state): from plexpy import pmsconnect, helpers import re @@ -300,11 +303,13 @@ def build_notify_text(session, state): duration = helpers.convert_milliseconds_to_minutes(item_metadata['duration']) view_offset = helpers.convert_milliseconds_to_minutes(session['view_offset']) - if session['paused_counter']: - stream_duration = int((time.time() - helpers.cast_to_float(session['started']) - - helpers.cast_to_float(session['paused_counter'])) / 60) - else: - stream_duration = int((time.time() - helpers.cast_to_float(session['started'])) / 60) + stream_duration = 0 + if state != 'play': + if session['paused_counter']: + stream_duration = int((time.time() - helpers.cast_to_float(session['started']) - + helpers.cast_to_float(session['paused_counter'])) / 60) + else: + stream_duration = int((time.time() - helpers.cast_to_float(session['started'])) / 60) progress_percent = helpers.get_percent(view_offset, duration) @@ -483,6 +488,7 @@ def build_notify_text(session, state): else: return None + def strip_tag(data): import re From 0204478483791c00e081b2b24f403306c9f60a81 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 23 Aug 2015 04:32:42 -0700 Subject: [PATCH 03/26] Add group editing of users from the user table From the user table, you can now: * Change the friendly name * Toggle notifications * Toggle keep history * Purge all user history (as a group selection) --- data/interfaces/default/css/plexpy.css | 23 ++++- data/interfaces/default/js/tables/users.js | 107 +++++++++++++++++---- data/interfaces/default/users.html | 87 ++++++++++++++++- plexpy/users.py | 8 +- 4 files changed, 201 insertions(+), 24 deletions(-) diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 7bbf8d46..81b24a97 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -418,6 +418,7 @@ input[type="color"], webkit-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + overflow: hidden; } .cover-face { background-position: center; @@ -826,8 +827,6 @@ input[type="color"], -ms-backface-visibility: hidden; -o-backface-visibility: hidden; backface-visibility: hidden; - width: auto; - height: 260px; border: 1px solid rgba(128, 128, 128, 0.3); } .summary-content { @@ -1684,6 +1683,26 @@ input[type="color"], .history-title .popover.right .popover-content { padding: 5px 8px; } +.edit-user-toggles { + padding-right: 10px; +} +.edit-user-toggles > input[type='checkbox'] { + display: none; +} +.edit-user-toggles > input[type='checkbox'] + label { + color: #444; + cursor: pointer; +} +.edit-user-toggles > input[type='checkbox']:checked + label { + color: #fff; + cursor: pointer; +} +.popover .popover-content { + color: #000; +} +#users-to-delete > li { + color: #e9a049; +} #updatebar { background-color: #444; color: #999999; diff --git a/data/interfaces/default/js/tables/users.js b/data/interfaces/default/js/tables/users.js index c3d1ae1e..b3f54778 100644 --- a/data/interfaces/default/js/tables/users.js +++ b/data/interfaces/default/js/tables/users.js @@ -11,13 +11,28 @@ users_list_table_options = { "processing": false, "serverSide": true, "pageLength": 10, - "order": [ 1, 'asc'], + "order": [ 2, 'asc'], "autoWidth": true, "stateSave": true, "pagingType": "bootstrap", "columnDefs": [ { "targets": [0], + "data": null, + "createdCell": function (td, cellData, rowData, row, col) { + $(td).html('
   ' + + ' ' + + ' ' + + // Show/hide user currently doesn't work + ''); + }, + "width": "7%", + "className": "edit-control no-wrap hidden", + "searchable": false, + "orderable": false + }, + { + "targets": [1], "data": "user_thumb", "createdCell": function (td, cellData, rowData, row, col) { if (cellData === '') { @@ -32,23 +47,26 @@ users_list_table_options = { "className": "users-poster-face" }, { - "targets": [1], + "targets": [2], "data": "friendly_name", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { if (rowData['user_id'] > 0) { - $(td).html('' + cellData + ''); + $(td).html(''); } else { - $(td).html('' + cellData + ''); + $(td).html(''); } } else { $(td).html(cellData); } }, - "width": "15%" + "width": "12%", + "className": "edit-user-control no-wrap" }, { - "targets": [2], + "targets": [3], "data": "last_seen", "render": function ( data, type, full ) { if (data) { @@ -58,11 +76,11 @@ users_list_table_options = { } }, "searchable": false, - "width": "15%", + "width": "12%", "className": "no-wrap hidden-xs" }, { - "targets": [3], + "targets": [4], "data": "ip_address", "createdCell": function (td, cellData, rowData, row, col) { if (cellData) { @@ -79,32 +97,32 @@ users_list_table_options = { $(td).html('n/a'); } }, - "width": "15%", + "width": "12%", "className": "no-wrap hidden-md hidden-sm hidden-xs modal-control-ip" }, { - "targets": [4], + "targets": [5], "data":"platform", "createdCell": function (td, cellData, rowData, row, col) { if (cellData) { var transcode_dec = ''; if (rowData['video_decision'] === 'transcode') { - transcode_dec = ' '; + transcode_dec = ''; } else if (rowData['video_decision'] === 'copy') { - transcode_dec = ' '; + transcode_dec = ''; } else if (rowData['video_decision'] === 'direct play' || rowData['video_decision'] === '') { - transcode_dec = ' '; + transcode_dec = ''; } $(td).html('
' + transcode_dec + ' ' + cellData + '
'); } else { $(td).html('n/a'); } }, - "width": "15%", + "width": "12%", "className": "no-wrap hidden-md hidden-sm hidden-xs modal-control" }, { - "targets": [5], + "targets": [6], "data":"last_watched", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { @@ -129,14 +147,15 @@ users_list_table_options = { } } }, + "width": "30%", "className": "hidden-sm hidden-xs" }, { - "targets": [6], + "targets": [7], "data": "plays", "searchable": false, "width": "10%" - } + } ], "drawCallback": function (settings) { @@ -145,6 +164,8 @@ users_list_table_options = { $('#ajaxMsg').fadeOut(); // Create the tooltips. + $('.purge-tooltip').tooltip(); + $('.edit-tooltip').tooltip(); $('.transcode-tooltip').tooltip(); $('.media-type-tooltip').tooltip(); $('.watched-tooltip').tooltip(); @@ -157,6 +178,11 @@ users_list_table_options = { } }); + if ($('#row-edit-mode').hasClass('active')) { + $('.edit-control').each(function () { + $(this).removeClass('hidden'); + }); + } }, "preDrawCallback": function(settings) { var msg = "
 Fetching rows...
"; @@ -204,4 +230,51 @@ $('#users_list_table').on('click', 'td.modal-control-ip', function () { } getUserLocation(rowData['ip_address']); +}); + +$('#users_list_table').on('change', 'td.edit-control > .edit-user-toggles > input, td.edit-user-control > .edit-user-name > input', function () { + var tr = $(this).parents('tr'); + var row = users_list_table.row(tr); + var rowData = row.data(); + + var do_notify = 0; + var keep_history = 0; + if ($('#do_notify-' + rowData['user_id']).is(':checked')) { + do_notify = 1; + } + if ($('#keep_history-' + rowData['user_id']).is(':checked')) { + keep_history = 1; + } + + friendly_name = tr.find('td.edit-user-control > .edit-user-name > input').val(); + + $.ajax({ + url: 'edit_user', + data: { + user_id: rowData['user_id'], + friendly_name: friendly_name, + do_notify: do_notify, + keep_history: keep_history, + thumb: rowData['user_thumb'] + }, + cache: false, + async: true, + success: function (data) { + var msg = "User updated"; + showMsg(msg, false, true, 2000); + } + }); +}); + +$('#users_list_table').on('click', 'td.edit-control > .edit-user-toggles > button', function () { + var tr = $(this).parents('tr'); + var row = users_list_table.row(tr); + var rowData = row.data(); + + //$(this).prop('disabled', true); + if ($(this).hasClass('active')) { + $(this).toggleClass('btn-warning').toggleClass('btn-danger'); + } else { + $(this).toggleClass('btn-danger').toggleClass('btn-warning'); + } }); \ No newline at end of file diff --git a/data/interfaces/default/users.html b/data/interfaces/default/users.html index 37cf9bc7..72cb2303 100644 --- a/data/interfaces/default/users.html +++ b/data/interfaces/default/users.html @@ -12,6 +12,11 @@ All Users
+ +   +
@@ -19,6 +24,7 @@ + @@ -35,6 +41,25 @@ + @@ -47,7 +72,7 @@ - + \ No newline at end of file diff --git a/plexpy/users.py b/plexpy/users.py index 8a24b38b..26f46abf 100644 --- a/plexpy/users.py +++ b/plexpy/users.py @@ -40,7 +40,9 @@ class Users(object): 'session_history_metadata.media_type', 'session_history.rating_key as rating_key', 'session_history_media_info.video_decision', - 'users.username as user' + 'users.username as user', + 'users.do_notify as do_notify', + 'users.keep_history as keep_history' ] try: query = data_tables.ssp_query(table_name='users', @@ -94,7 +96,9 @@ class Users(object): "video_decision": item['video_decision'], "user_thumb": user_thumb, "user": item["user"], - "user_id": item['user_id'] + "user_id": item['user_id'], + "do_notify": helpers.checked(item['do_notify']), + "keep_history": helpers.checked(item['keep_history']) } rows.append(row) From 685f8cabdbaa0fdc50112f1c36b6de91d98adaa7 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 23 Aug 2015 11:20:36 -0700 Subject: [PATCH 04/26] Fix popover relocating on window resizing Also stay under the navbar if scrolling down the page. --- data/interfaces/default/css/plexpy.css | 10 ++++++++++ data/interfaces/default/users.html | 11 ++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 81b24a97..b189f73a 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -1697,9 +1697,19 @@ input[type="color"], color: #fff; cursor: pointer; } +.popover { + z-index: 2; +} .popover .popover-content { color: #000; } +.noTransition +{ + -moz-transition: none !important; + -webkit-transition: none !important; + -o-transition: none !important; + transition: none !important; +} #users-to-delete > li { color: #e9a049; } diff --git a/data/interfaces/default/users.html b/data/interfaces/default/users.html index 72cb2303..38ecca5f 100644 --- a/data/interfaces/default/users.html +++ b/data/interfaces/default/users.html @@ -87,7 +87,7 @@ var users_to_purge = []; $('#row-edit-mode').on('click', function () { - $(this).parents('span#purge-message').popover('toggle'); + $('#purge-message').popover(); if ($(this).hasClass('active')) { users_to_purge = []; @@ -141,6 +141,15 @@ } }); + + $(window).resize(function () { + if ($('.popover').popover().is(':visible')) { + var popover = $('.popover'); + popover.addClass("noTransition"); + $('#purge-message').popover('show'); + popover.removeClass("noTransition"); + } + }); }); $("#refresh-users-list").click(function() { From 7eac5213692db57071705396ee90cf60909d42e3 Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 23 Aug 2015 23:01:10 +0200 Subject: [PATCH 05/26] Remove max width restriction on home stats cards. --- data/interfaces/default/css/plexpy.css | 1 - 1 file changed, 1 deletion(-) diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index b189f73a..f7343fff 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -1289,7 +1289,6 @@ input[type="color"], left: 0px; } .home-platforms { - max-width: 1600px; } .home-platforms ul { list-style: none; From 0ff1b4d5dd37374b03725af073b9c08894a86c84 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 23 Aug 2015 14:25:51 -0700 Subject: [PATCH 06/26] Add modal confirm box for purging of individual user history --- data/interfaces/default/edit_user.html | 53 ++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/data/interfaces/default/edit_user.html b/data/interfaces/default/edit_user.html index cb1a5775..1e19b66e 100644 --- a/data/interfaces/default/edit_user.html +++ b/data/interfaces/default/edit_user.html @@ -74,6 +74,24 @@ DOCUMENTATION :: END + From 7ba6d704cd132485f8aad74e6e0b3e996dd9c1cf Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 23 Aug 2015 15:27:36 -0700 Subject: [PATCH 07/26] Add group delete feature to history table * This helps to prevent accidental row deletes --- data/interfaces/default/history.html | 65 +++++++++++++++++-- .../default/js/tables/history_table.js | 25 +++---- data/interfaces/default/js/tables/users.js | 1 - data/interfaces/default/users.html | 1 - 4 files changed, 70 insertions(+), 22 deletions(-) diff --git a/data/interfaces/default/history.html b/data/interfaces/default/history.html index 9e1ec5f6..99969849 100644 --- a/data/interfaces/default/history.html +++ b/data/interfaces/default/history.html @@ -14,7 +14,11 @@ History
-   + +   +
@@ -42,6 +46,24 @@ + @@ -68,18 +90,53 @@ clearSearchButton('history_table', history_table); - $('#row-edit-mode').click(function() { + var history_to_purge = []; + $('#row-edit-mode').on('click', function() { + $('#delete-message').popover(); + if ($(this).hasClass('active')) { - $('.delete-control').each(function() { + history_to_purge = []; + $('.delete-control button.btn-danger').map(function () { + history_to_purge.push($(this).attr('data-id')); + }); + if (history_to_purge.length > 0) { + $('#confirm-modal').modal(); + $('#confirm-modal').one('click', '#confirm-delete', function () { + for (var i = 0; i < history_to_purge.length; i++) { + $.ajax({ + url: 'delete_history_rows', + data: { row_id: history_to_purge[i] }, + async: true, + success: function (data) { + var msg = "User history purged"; + showMsg(msg, false, true, 2000); + } + }); + } + history_table.draw(); + }); + } + + $('.delete-control').each(function () { + $(this).find('button.btn-danger').toggleClass('btn-warning').toggleClass('btn-danger'); $(this).addClass('hidden'); }); + } else { $('.delete-control').each(function() { $(this).removeClass('hidden'); }); } }); - }); + $(window).resize(function () { + if ($('.popover').popover().is(':visible')) { + var popover = $('.popover'); + popover.addClass("noTransition"); + $('#delete-message').popover('show'); + popover.removeClass("noTransition"); + } + }); + }); diff --git a/data/interfaces/default/js/tables/history_table.js b/data/interfaces/default/js/tables/history_table.js index 9898cc1b..dcff4514 100644 --- a/data/interfaces/default/js/tables/history_table.js +++ b/data/interfaces/default/js/tables/history_table.js @@ -32,7 +32,7 @@ history_table_options = { "targets": [0], "data": null, "createdCell": function (td, cellData, rowData, row, col) { - $(td).html(''); + $(td).html(''); }, "width": "5%", "className": "delete-control no-wrap hidden", @@ -98,11 +98,11 @@ history_table_options = { if (cellData !== '') { var transcode_dec = ''; if (rowData['video_decision'] === 'transcode') { - transcode_dec = ' '; + transcode_dec = ''; } else if (rowData['video_decision'] === 'copy') { - transcode_dec = ' '; + transcode_dec = ''; } else if (rowData['video_decision'] === 'direct play' || rowData['video_decision'] === '') { - transcode_dec = ' '; + transcode_dec = ''; } $(td).html(''); } @@ -287,16 +287,9 @@ $('#history_table').on('click', 'td.delete-control > button', function () { var row = history_table.row( tr ); var rowData = row.data(); - $(this).prop('disabled', true); - $(this).html(' Delete'); - - $.ajax({ - url: 'delete_history_rows', - data: {row_id: rowData['id']}, - async: true, - success: function(data) { - history_table.ajax.reload(null, false); - } - }); - + if ($(this).hasClass('active')) { + $(this).toggleClass('btn-warning').toggleClass('btn-danger'); + } else { + $(this).toggleClass('btn-danger').toggleClass('btn-warning'); + } }); \ No newline at end of file diff --git a/data/interfaces/default/js/tables/users.js b/data/interfaces/default/js/tables/users.js index b3f54778..5f1e4304 100644 --- a/data/interfaces/default/js/tables/users.js +++ b/data/interfaces/default/js/tables/users.js @@ -271,7 +271,6 @@ $('#users_list_table').on('click', 'td.edit-control > .edit-user-toggles > butto var row = users_list_table.row(tr); var rowData = row.data(); - //$(this).prop('disabled', true); if ($(this).hasClass('active')) { $(this).toggleClass('btn-warning').toggleClass('btn-danger'); } else { diff --git a/data/interfaces/default/users.html b/data/interfaces/default/users.html index 38ecca5f..df36a858 100644 --- a/data/interfaces/default/users.html +++ b/data/interfaces/default/users.html @@ -97,7 +97,6 @@ users_to_purge.push($(this).attr('data-id')); ul.append('
  • ' + $('div[data-id=' + $(this).attr('data-id') + '] > input').val() + '
  • ') }); - console.log(users_to_purge); if (users_to_purge.length > 0) { $('#users-to-delete').append $('#confirm-modal').modal(); From 609549f9747d737a7e81762534bdf1eb195ea6fa Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 23 Aug 2015 15:33:41 -0700 Subject: [PATCH 08/26] Also add group delete to user history and info pages --- data/interfaces/default/history.html | 4 +- data/interfaces/default/info.html | 55 +++++++++++++++++++++++++-- data/interfaces/default/user.html | 56 ++++++++++++++++++++++++++-- 3 files changed, 106 insertions(+), 9 deletions(-) diff --git a/data/interfaces/default/history.html b/data/interfaces/default/history.html index 99969849..3f0fd33b 100644 --- a/data/interfaces/default/history.html +++ b/data/interfaces/default/history.html @@ -51,7 +51,7 @@ diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 8eba3f9b..4a85a3d4 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -185,7 +185,11 @@ DOCUMENTATION :: END Watch History for ${data['title']}
    -   + +   +
    @@ -214,6 +218,24 @@ DOCUMENTATION :: END + @@ -281,11 +303,38 @@ DOCUMENTATION :: END clearSearchButton('history_table', history_table); - $('#row-edit-mode').click(function() { + var history_to_purge = []; + $('#row-edit-mode').on('click', function() { + $('#delete-message').popover(); + if ($(this).hasClass('active')) { - $('.delete-control').each(function() { + history_to_purge = []; + $('.delete-control button.btn-danger').map(function () { + history_to_purge.push($(this).attr('data-id')); + }); + if (history_to_purge.length > 0) { + $('#confirm-modal').modal(); + $('#confirm-modal').one('click', '#confirm-delete', function () { + for (var i = 0; i < history_to_purge.length; i++) { + $.ajax({ + url: 'delete_history_rows', + data: { row_id: history_to_purge[i] }, + async: true, + success: function (data) { + var msg = "User history purged"; + showMsg(msg, false, true, 2000); + } + }); + } + history_table.draw(); + }); + } + + $('.delete-control').each(function () { + $(this).find('button.btn-danger').toggleClass('btn-warning').toggleClass('btn-danger'); $(this).addClass('hidden'); }); + } else { $('.delete-control').each(function() { $(this).removeClass('hidden'); diff --git a/data/interfaces/default/user.html b/data/interfaces/default/user.html index 4727be64..979b8113 100644 --- a/data/interfaces/default/user.html +++ b/data/interfaces/default/user.html @@ -155,7 +155,11 @@ from plexpy import helpers
    -   + +   +
    @@ -227,6 +231,24 @@ from plexpy import helpers +
    @@ -368,12 +390,38 @@ from plexpy import helpers }); }); - // Delete mode button - $('#row-edit-mode').click(function() { + var history_to_purge = []; + $('#row-edit-mode').on('click', function() { + $('#delete-message').popover(); + if ($(this).hasClass('active')) { - $('.delete-control').each(function() { + history_to_purge = []; + $('.delete-control button.btn-danger').map(function () { + history_to_purge.push($(this).attr('data-id')); + }); + if (history_to_purge.length > 0) { + $('#confirm-modal').modal(); + $('#confirm-modal').one('click', '#confirm-delete', function () { + for (var i = 0; i < history_to_purge.length; i++) { + $.ajax({ + url: 'delete_history_rows', + data: { row_id: history_to_purge[i] }, + async: true, + success: function (data) { + var msg = "User history purged"; + showMsg(msg, false, true, 2000); + } + }); + } + history_table.draw(); + }); + } + + $('.delete-control').each(function () { + $(this).find('button.btn-danger').toggleClass('btn-warning').toggleClass('btn-danger'); $(this).addClass('hidden'); }); + } else { $('.delete-control').each(function() { $(this).removeClass('hidden'); From 81a8d93336aa757887d13831ccde798a7a778c9e Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 23 Aug 2015 15:58:16 -0700 Subject: [PATCH 09/26] Fix size of posters pulled from Plex --- data/interfaces/default/home_stats.html | 8 ++++---- data/interfaces/default/info.html | 8 ++++---- data/interfaces/default/recently_added.html | 4 ++-- data/interfaces/default/user_recently_watched.html | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/data/interfaces/default/home_stats.html b/data/interfaces/default/home_stats.html index 2a05ca34..fbe42b5b 100644 --- a/data/interfaces/default/home_stats.html +++ b/data/interfaces/default/home_stats.html @@ -83,7 +83,7 @@ DOCUMENTATION :: END % if a['rows'][0]['grandparent_thumb']:
    -
    +
    % else:
    @@ -111,7 +111,7 @@ DOCUMENTATION :: END % if a['rows'][0]['grandparent_thumb'] != '':
    -
    +
    % else:
    @@ -143,7 +143,7 @@ DOCUMENTATION :: END % if a['rows'][0]['thumb']:
    -
    +
    % else:
    @@ -171,7 +171,7 @@ DOCUMENTATION :: END % if a['rows'][0]['thumb']:
    -
    +
    % else:
    diff --git a/data/interfaces/default/recently_added.html b/data/interfaces/default/recently_added.html index 75482622..dd68e5a1 100644 --- a/data/interfaces/default/recently_added.html +++ b/data/interfaces/default/recently_added.html @@ -32,7 +32,7 @@ DOCUMENTATION :: END % if item['type'] == 'season' or item['type'] == 'movie':
    -
    +
    % if item['type'] == 'season': @@ -47,7 +47,7 @@ DOCUMENTATION :: END % elif item['type'] == 'album':
    -
    +

    ${item['parent_title']}

    diff --git a/data/interfaces/default/user_recently_watched.html b/data/interfaces/default/user_recently_watched.html index 2cf7b57c..c57ebdfc 100644 --- a/data/interfaces/default/user_recently_watched.html +++ b/data/interfaces/default/user_recently_watched.html @@ -36,7 +36,7 @@ DOCUMENTATION :: END
  • -
    +
    % if item['type'] == 'episode': From ff6d43c3988c160ad63c6691bab6ab7a8d65b481 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 23 Aug 2015 17:06:05 -0700 Subject: [PATCH 10/26] Fixed numbers swapped --- data/interfaces/default/home_stats.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/interfaces/default/home_stats.html b/data/interfaces/default/home_stats.html index fbe42b5b..7cd47371 100644 --- a/data/interfaces/default/home_stats.html +++ b/data/interfaces/default/home_stats.html @@ -171,7 +171,7 @@ DOCUMENTATION :: END % if a['rows'][0]['thumb']:
    -
    +
    % else:
    From 31805e39e64e9d6ee6f2c74f579b8babc32895b9 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 23 Aug 2015 17:46:44 -0700 Subject: [PATCH 11/26] Change class name for consistency --- data/interfaces/default/css/plexpy.css | 2 +- data/interfaces/default/user_platform_stats.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index f7343fff..9f1fc18a 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -1245,7 +1245,7 @@ input[type="color"], } .user-platforms-instance li { } -.user-platforms-instance-poster { +.user-platforms-instance-box { float: left; width: 75px; border-radius: 3px; diff --git a/data/interfaces/default/user_platform_stats.html b/data/interfaces/default/user_platform_stats.html index c281b48b..afd1d6b3 100644 --- a/data/interfaces/default/user_platform_stats.html +++ b/data/interfaces/default/user_platform_stats.html @@ -34,7 +34,7 @@ DOCUMENTATION :: END
    % endfor % else: From 77f5224e13248c4113861fccab44954c9c06df6b Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 23 Aug 2015 23:23:23 -0700 Subject: [PATCH 12/26] Moved settings around to more logical locations --- data/interfaces/default/settings.html | 69 +++++++++++++-------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index dcc8e164..3145c4ae 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -83,6 +83,25 @@ available_notification_agents = notifiers.available_notification_agents()

    Set your preferred time format. Click here to see the parameter list.

  • +
    +

    Homepage Statistics

    +
    + +
    + +
    +
    + +
    +
    +

    Specify the number of days for the statistics on the home page. Default is 30 days.

    +
    +
    + +

    Use play duration instead of play count to generate statistics.

    +

    @@ -221,9 +240,24 @@ available_notification_agents = notifiers.available_notification_agents()

    Force PlexPy to connect to your Plex Server via SSL. Your server needs to have remote access enabled.

    +
    +

    Plex Logs

    +
    + +
    + +
    +
    + +
    +
    +

    Set the folder where your Plex Server logs are. This is required if you enable IP logging.
    Click here for help.

    +
    + +
    @@ -278,41 +312,6 @@ available_notification_agents = notifiers.available_notification_agents()

    If you have media indexing enabled on your server, use these on the activity pane.

    -
    -

    Homepage Statistics

    -
    - -
    - -
    -
    - -
    -
    -

    Specify the number of days for the statistics on the home page. Default is 30 days.

    -
    -
    - -

    Use play duration instead of play count to generate statistics.

    -
    - -
    -

    Plex Logs

    -
    - -
    - -
    -
    - -
    -
    -

    Set the folder where your Plex Server logs are. This is required if you enable IP logging.
    Click here for help.

    -
    - -

    PlexWatch Import Tool

    From 79757da2b1e0ee065a19fe226e965c2e95490b41 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 23 Aug 2015 23:25:55 -0700 Subject: [PATCH 13/26] Update user images --- data/interfaces/default/css/plexpy.css | 37 ++++++++++++++++++++-- data/interfaces/default/js/tables/users.js | 5 ++- data/interfaces/default/user.html | 3 +- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 9f1fc18a..0957937f 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -431,6 +431,19 @@ input[type="color"], -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); } +.users-poster-face { + overflow: hidden; + float: left; + background-size: contain; + height: 40px; + width: 40px; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; + webkit-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); +} .users-poster-face img { bottom: 0; overflow: hidden; @@ -1127,6 +1140,16 @@ input[type="color"], .user-info-poster-face { float: left; margin-top: 15px; + margin-right: 15px; + background-size: contain; + height: 80px; + width: 80px; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; + webkit-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); } .user-info-poster-face img { bottom: 0; @@ -1249,9 +1272,9 @@ input[type="color"], float: left; width: 75px; border-radius: 3px; - -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.5); - -moz-box-shadow: 0 0 5px rgba(0,0,0,0.5); - box-shadow: 0 0 5px rgba(0,0,0,0.5); + webkit-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); background-size: contain; position: relative; height: 80px; @@ -1308,7 +1331,12 @@ input[type="color"], bottom: 35px; height: 80px; width: 80px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; border-radius: 3px; + webkit-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); } .home-platforms-instance-oval { background-size: contain; @@ -1320,6 +1348,9 @@ input[type="color"], -webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%; + webkit-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); } .home-platforms-instance-name { float: left; diff --git a/data/interfaces/default/js/tables/users.js b/data/interfaces/default/js/tables/users.js index b3f54778..b2974cff 100644 --- a/data/interfaces/default/js/tables/users.js +++ b/data/interfaces/default/js/tables/users.js @@ -36,15 +36,14 @@ users_list_table_options = { "data": "user_thumb", "createdCell": function (td, cellData, rowData, row, col) { if (cellData === '') { - $(td).html('User Logo'); + $(td).html('
    '); } else { - $(td).html('User Logo'); + $(td).html('
    '); } }, "orderable": false, "searchable": false, "width": "5%", - "className": "users-poster-face" }, { "targets": [2], diff --git a/data/interfaces/default/user.html b/data/interfaces/default/user.html index 4727be64..0572aa08 100644 --- a/data/interfaces/default/user.html +++ b/data/interfaces/default/user.html @@ -40,8 +40,7 @@ from plexpy import helpers
    Edit User Last Seen