From 2d19accdd1c147bddcfa35b1ffdbde8bc8b75a0f Mon Sep 17 00:00:00 2001 From: drzoidberg33 Date: Sun, 23 Aug 2015 00:08:55 +0200 Subject: [PATCH 1/4] Revert "Info pages" --- data/interfaces/default/css/plexpy.css | 20 ++------- data/interfaces/default/info.html | 56 +++++++++++--------------- plexpy/pmsconnect.py | 5 +-- 3 files changed, 27 insertions(+), 54 deletions(-) diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 7bbf8d46..7d715a3c 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -23,7 +23,7 @@ select { outline: none; } select.input-sm { - margin: 5px 0 5px 0; + margin: 5px 0 5px 0; border: 2px solid #444; background: #333; -webkit-border-radius: 2px; @@ -34,8 +34,8 @@ select.input-sm { } img { -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; } .navbar { background: #000; @@ -792,11 +792,6 @@ input[type="color"], width: 174px; height: 260px; } -.summary-content-poster a:hover .poster-face { - webkit-box-shadow: inset 0 0 0 2px #e9a049; - -moz-box-shadow: inset 0 0 0 2px #e9a049; - box-shadow: inset 0 0 0 2px #e9a049; -} .summary-content-poster img { bottom: 0; overflow: hidden; @@ -848,13 +843,6 @@ input[type="color"], line-height: 32px; float: left; } -.summary-content-title h1 a{ - color: #F9AA03; -} -.summary-content-title h1 a:hover{ - color: #F9AA03; - text-decoration: underline; -} .summary-content-details-wrapper { width: 100%; padding-bottom: 15px; @@ -921,8 +909,6 @@ input[type="color"], } .summary-content-people-wrapper { margin-top: 25px; - margin-right: 25px; - float: left; } .summary-content-people-wrapper hidden-phone hidden-tablet { overflow: hidden; diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 8eba3f9b..b2ba2b98 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -54,18 +54,10 @@ DOCUMENTATION :: END
-
@@ -342,8 +332,8 @@ DOCUMENTATION :: END % endif % endif diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index 7fb15618..54d2093f 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -1,4 +1,4 @@ -# This file is part of PlexPy. +# This file is part of PlexPy. # # PlexPy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -334,8 +334,6 @@ class PmsConnect(object): elif metadata_type == 'episode': metadata = {'type': metadata_type, 'rating_key': helpers.get_xml_attr(metadata_main, 'ratingKey'), - 'parent_rating_key': helpers.get_xml_attr(metadata_main, 'parentRatingKey'), - 'grandparent_rating_key': helpers.get_xml_attr(metadata_main, 'grandparentRatingKey'), 'grandparent_title': helpers.get_xml_attr(metadata_main, 'grandparentTitle'), 'parent_index': helpers.get_xml_attr(metadata_main, 'parentIndex'), 'parent_title': helpers.get_xml_attr(metadata_main, 'parentTitle'), @@ -396,7 +394,6 @@ class PmsConnect(object): show_details = self.get_metadata_details(parent_rating_key) metadata = {'type': metadata_type, 'rating_key': helpers.get_xml_attr(metadata_main, 'ratingKey'), - 'parent_rating_key': helpers.get_xml_attr(metadata_main, 'parentRatingKey'), 'grandparent_title': helpers.get_xml_attr(metadata_main, 'grandparentTitle'), 'parent_index': helpers.get_xml_attr(metadata_main, 'parentIndex'), 'parent_title': helpers.get_xml_attr(metadata_main, 'parentTitle'), From 29204cb6ba5bc6cf89ab41a09b90e373f4e1988a Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 6 Sep 2015 15:33:17 +0200 Subject: [PATCH 2/4] Fix weird issue with bad merge. --- plexpy/pmsconnect.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index 8bb317b0..d25e783e 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -1,4 +1,4 @@ -# This file is part of PlexPy. +# This file is part of PlexPy. # # PlexPy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -383,6 +383,8 @@ class PmsConnect(object): elif metadata_type == 'episode': metadata = {'type': metadata_type, 'rating_key': helpers.get_xml_attr(metadata_main, 'ratingKey'), + 'parent_rating_key': helpers.get_xml_attr(metadata_main, 'parentRatingKey'), + 'grandparent_rating_key': helpers.get_xml_attr(metadata_main, 'grandparentRatingKey'), 'grandparent_title': helpers.get_xml_attr(metadata_main, 'grandparentTitle'), 'parent_index': helpers.get_xml_attr(metadata_main, 'parentIndex'), 'parent_title': helpers.get_xml_attr(metadata_main, 'parentTitle'), @@ -443,6 +445,7 @@ class PmsConnect(object): show_details = self.get_metadata_details(parent_rating_key) metadata = {'type': metadata_type, 'rating_key': helpers.get_xml_attr(metadata_main, 'ratingKey'), + 'parent_rating_key': helpers.get_xml_attr(metadata_main, 'parentRatingKey'), 'grandparent_title': helpers.get_xml_attr(metadata_main, 'grandparentTitle'), 'parent_index': helpers.get_xml_attr(metadata_main, 'parentIndex'), 'parent_title': helpers.get_xml_attr(metadata_main, 'parentTitle'), From 00934b04d2a4af1782fd2f8850cf2d78d593139e Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Thu, 26 Nov 2015 19:06:51 -0800 Subject: [PATCH 3/4] Fix IP logging again * Really this time... --- plexpy/activity_processor.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plexpy/activity_processor.py b/plexpy/activity_processor.py index e64b88da..e64308c7 100644 --- a/plexpy/activity_processor.py +++ b/plexpy/activity_processor.py @@ -39,7 +39,7 @@ class ActivityProcessor(object): 'parent_title': session['parent_title'], 'grandparent_title': session['grandparent_title'], 'friendly_name': session['friendly_name'], - 'ip_address': session['ip_address'], + #'ip_address': session['ip_address'], 'player': session['player'], 'platform': session['platform'], 'parent_rating_key': session['parent_rating_key'], @@ -67,6 +67,10 @@ class ActivityProcessor(object): 'transcode_height': session['transcode_height'] } + # Add ip_address back into values + if session['ip_address']: + values.update({'ip_address': session['ip_address']}) + keys = {'session_key': session['session_key'], 'rating_key': session['rating_key']} @@ -88,12 +92,8 @@ class ActivityProcessor(object): if plexpy.CONFIG.IP_LOGGING_ENABLE and plexpy.CONFIG.PMS_LOGS_FOLDER: ip_address = self.find_session_ip(rating_key=session['rating_key'], machine_id=session['machine_id']) - else: - ip_adress = None - - query = 'UPDATE sessions SET ip_address = ? WHERE session_key = ? AND rating_key = ? ' - args = [ip_address, session['session_key'], session['rating_key']] - self.db.action(query=query, args=args) + ip_address = {'ip_address': ip_address} + self.db.upsert('sessions', ip_address, keys) def write_session_history(self, session=None, import_metadata=None, is_import=False, import_ignore_interval=0): from plexpy import users From 790ca9c90a34f3245c0f23680f0b741dabfebe5d Mon Sep 17 00:00:00 2001 From: logaritmisk Date: Mon, 3 Oct 2016 22:27:21 +0200 Subject: [PATCH 4/4] Human file size for media info table. --- .../default/js/tables/media_info_table.js | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/data/interfaces/default/js/tables/media_info_table.js b/data/interfaces/default/js/tables/media_info_table.js index 46c34fa3..66004622 100644 --- a/data/interfaces/default/js/tables/media_info_table.js +++ b/data/interfaces/default/js/tables/media_info_table.js @@ -280,8 +280,8 @@ media_info_table_options = { } $("#media_info_table-SID-" + section_id + "_info").append(''); + humanFileSize(settings.json.filtered_file_size) + + ' (filtered from ' + humanFileSize(settings.json.total_file_size) + ')'); }, "preDrawCallback": function(settings) { var msg = " Fetching rows..."; @@ -484,4 +484,21 @@ function createChildTableMedia(row, rowData) { createChildTableMedia(row, rowData); } }); -} \ No newline at end of file +} + +// Taken from http://stackoverflow.com/questions/10420352/converting-file-size-in-bytes-to-human-readable#answer-14919494 +function humanFileSize(bytes, si) { + var thresh = si ? 1000 : 1024; + if(Math.abs(bytes) < thresh) { + return bytes + ' B'; + } + var units = si + ? ['kB','MB','GB','TB','PB','EB','ZB','YB'] + : ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB']; + var u = -1; + do { + bytes /= thresh; + ++u; + } while(Math.abs(bytes) >= thresh && u < units.length - 1); + return bytes.toFixed(1)+' '+units[u]; +}