diff --git a/CHANGELOG.md b/CHANGELOG.md index 703bbd48..8d5e5552 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,16 @@ # Changelog +## v1.3.3 (2016-01-26) + +* Fix: Plays by Month graph not loading. +* Change: Disable caching for datatables. +* Change: Improved updating library data in the database again. + + ## v1.3.2 (2016-01-24) -* Fix: 'datestamp' and 'timestamp' for server notifications -* Change: New method for updating library data in database +* Fix: 'datestamp' and 'timestamp' for server notifications. +* Change: New method for updating library data in database. ## v1.3.1 (2016-01-23) @@ -13,8 +20,8 @@ * Fix: Star rating overlapping text. * Fix: Unable to startup when library refresh fails. * Fix: Unable to parse 'datestamp' and 'timestamp' format. -* Change: Rename "Last Watched" to "Last Played" -* Change: More descriptive libraries updating message +* Change: Rename "Last Watched" to "Last Played". +* Change: More descriptive libraries updating message. ## v1.3.0 (2016-01-23) diff --git a/data/interfaces/default/js/tables/history_table.js b/data/interfaces/default/js/tables/history_table.js index 2f337189..2ecde57a 100644 --- a/data/interfaces/default/js/tables/history_table.js +++ b/data/interfaces/default/js/tables/history_table.js @@ -22,7 +22,7 @@ history_table_options = { "emptyTable": "No data in table" }, "pagingType": "bootstrap", - "stateSave": true, + "stateSave": false, "processing": false, "serverSide": true, "pageLength": 25, diff --git a/data/interfaces/default/js/tables/libraries.js b/data/interfaces/default/js/tables/libraries.js index 2fcb3346..377295ae 100644 --- a/data/interfaces/default/js/tables/libraries.js +++ b/data/interfaces/default/js/tables/libraries.js @@ -16,7 +16,7 @@ libraries_list_table_options = { "pageLength": 10, "order": [ 2, 'asc'], "autoWidth": true, - "stateSave": true, + "stateSave": false, "pagingType": "bootstrap", "columnDefs": [ { diff --git a/data/interfaces/default/js/tables/logs.js b/data/interfaces/default/js/tables/logs.js index b8a21d39..4d26d2cd 100644 --- a/data/interfaces/default/js/tables/logs.js +++ b/data/interfaces/default/js/tables/logs.js @@ -5,7 +5,7 @@ var log_table_options = { "pagingType": "bootstrap", "order": [ 0, 'desc'], "pageLength": 50, - "stateSave": true, + "stateSave": false, "language": { "search":"Search: ", "lengthMenu":"Show _MENU_ lines per page", diff --git a/data/interfaces/default/js/tables/plex_logs.js b/data/interfaces/default/js/tables/plex_logs.js index 8a1109ba..520eae42 100644 --- a/data/interfaces/default/js/tables/plex_logs.js +++ b/data/interfaces/default/js/tables/plex_logs.js @@ -5,7 +5,7 @@ var plex_log_table_options = { "pagingType": "bootstrap", "order": [ 0, 'desc'], "pageLength": 50, - "stateSave": true, + "stateSave": false, "language": { "search":"Search: ", "lengthMenu":"Show _MENU_ lines per page", diff --git a/data/interfaces/default/js/tables/sync_table.js b/data/interfaces/default/js/tables/sync_table.js index 94f4e289..a46c67d2 100644 --- a/data/interfaces/default/js/tables/sync_table.js +++ b/data/interfaces/default/js/tables/sync_table.js @@ -4,7 +4,7 @@ sync_table_options = { "pagingType": "bootstrap", "order": [ [ 0, 'desc'], [ 1, 'asc'], [2, 'asc'] ], "pageLength": 25, - "stateSave": true, + "stateSave": false, "language": { "search":"Search: ", "lengthMenu":"Show _MENU_ lines per page", diff --git a/data/interfaces/default/js/tables/user_ips.js b/data/interfaces/default/js/tables/user_ips.js index d025d7d6..16c3b9df 100644 --- a/data/interfaces/default/js/tables/user_ips.js +++ b/data/interfaces/default/js/tables/user_ips.js @@ -8,7 +8,7 @@ user_ip_table_options = { "infoFiltered":"(filtered from _MAX_ total entries)", "emptyTable": "No data in table", }, - "stateSave": true, + "stateSave": false, "pagingType": "bootstrap", "processing": false, "serverSide": true, diff --git a/data/interfaces/default/js/tables/users.js b/data/interfaces/default/js/tables/users.js index aeda3df1..f7147a17 100644 --- a/data/interfaces/default/js/tables/users.js +++ b/data/interfaces/default/js/tables/users.js @@ -16,7 +16,7 @@ users_list_table_options = { "pageLength": 10, "order": [ 2, 'asc'], "autoWidth": true, - "stateSave": true, + "stateSave": false, "pagingType": "bootstrap", "columnDefs": [ { diff --git a/plexpy/graphs.py b/plexpy/graphs.py index bcede4d5..e5d93720 100644 --- a/plexpy/graphs.py +++ b/plexpy/graphs.py @@ -14,9 +14,9 @@ # along with PlexPy. If not, see . from plexpy import logger, database, helpers, common +import plexpy import datetime -import locale class Graphs(object): @@ -321,7 +321,7 @@ class Graphs(object): dt = datetime.datetime(*month_item[:6]) date_string = dt.strftime('%Y-%m') - categories.append(dt.strftime('%b %Y').decode(locale.getlocale()[1])) + categories.append(dt.strftime('%b %Y').decode(plexpy.SYS_ENCODING, 'replace')) series_1_value = 0 series_2_value = 0 series_3_value = 0 diff --git a/plexpy/libraries.py b/plexpy/libraries.py index fb8029b7..61a2f621 100644 --- a/plexpy/libraries.py +++ b/plexpy/libraries.py @@ -35,7 +35,8 @@ def update_section_ids(): monitor_db = database.MonitorDatabase() try: - query = 'SELECT id, rating_key FROM session_history_metadata WHERE section_id IS NULL' + query = 'SELECT id, rating_key, grandparent_rating_key, media_type ' \ + 'FROM session_history_metadata WHERE section_id IS NULL' history_results = monitor_db.select(query=query) query = 'SELECT section_id, section_type FROM library_sections' library_results = monitor_db.select(query=query) @@ -58,38 +59,35 @@ def update_section_ids(): # Get rating_key: section_id mapping pairs key_mappings = {} - section_type_child = {'movie': 'movie', - 'show': 'episode', - 'artist': 'track'} pms_connect = pmsconnect.PmsConnect() for library in library_results: section_id = library['section_id'] - section_type = section_type_child.get(library['section_type'], None) + section_type = library['section_type'] - if section_type: + if section_type != 'photo': library_children = pms_connect.get_library_children_details(section_id=section_id, section_type=section_type) - else: - continue - - if library_children: - children_list = library_children['childern_list'] - key_mappings.update({child['rating_key']:child['section_id'] for child in children_list}) - else: - logger.warn(u"PlexPy Libraries :: Unable to get a list of library items for section_id %s." % section_id) + if library_children: + children_list = library_children['childern_list'] + key_mappings.update({child['rating_key']:child['section_id'] for child in children_list}) + else: + logger.warn(u"PlexPy Libraries :: Unable to get a list of library items for section_id %s." % section_id) error_keys = set() for item in history_results: - rating_key = item['rating_key'] + rating_key = item['grandparent_rating_key'] if item['media_type'] != 'movie' else item['rating_key'] section_id = key_mappings.get(str(rating_key), None) if section_id: - section_keys = {'id': item['id']} - section_values = {'section_id': section_id} - monitor_db.upsert('session_history_metadata', key_dict=section_keys, value_dict=section_values) + try: + section_keys = {'id': item['id']} + section_values = {'section_id': section_id} + monitor_db.upsert('session_history_metadata', key_dict=section_keys, value_dict=section_values) + except: + error_keys.add(item['rating_key']) else: - error_keys.add(rating_key) + error_keys.add(item['rating_key']) # Remove thread filter from the logger #for handler in logger.logger.handlers: diff --git a/plexpy/version.py b/plexpy/version.py index 14eb13d0..9dd70962 100644 --- a/plexpy/version.py +++ b/plexpy/version.py @@ -1,2 +1,2 @@ PLEXPY_VERSION = "master" -PLEXPY_RELEASE_VERSION = "1.3.2" +PLEXPY_RELEASE_VERSION = "1.3.3"