From b1ea3bcd4e1d704477695d8e629dfeb213894475 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sat, 23 Jan 2016 14:06:25 -0800 Subject: [PATCH] Rename last watched to last played --- data/interfaces/default/home_stats.html | 2 +- data/interfaces/default/js/tables/libraries.js | 2 +- .../default/js/tables/media_info_table.js | 4 ++-- data/interfaces/default/js/tables/user_ips.js | 2 +- data/interfaces/default/js/tables/users.js | 2 +- data/interfaces/default/libraries.html | 2 +- data/interfaces/default/library.html | 2 +- data/interfaces/default/settings.html | 2 +- data/interfaces/default/user.html | 2 +- data/interfaces/default/users.html | 2 +- plexpy/libraries.py | 14 +++++++------- plexpy/users.py | 8 ++++---- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/data/interfaces/default/home_stats.html b/data/interfaces/default/home_stats.html index de0995ea..eb48bee8 100644 --- a/data/interfaces/default/home_stats.html +++ b/data/interfaces/default/home_stats.html @@ -692,7 +692,7 @@ DOCUMENTATION :: END
  • -

    Last Watched

    +

    Last Played

    diff --git a/data/interfaces/default/js/tables/libraries.js b/data/interfaces/default/js/tables/libraries.js index c49ef8ee..ac06b187 100644 --- a/data/interfaces/default/js/tables/libraries.js +++ b/data/interfaces/default/js/tables/libraries.js @@ -133,7 +133,7 @@ libraries_list_table_options = { }, { "targets": [8], - "data":"last_watched", + "data":"last_played", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== null && cellData !== '') { var media_type = ''; diff --git a/data/interfaces/default/js/tables/media_info_table.js b/data/interfaces/default/js/tables/media_info_table.js index 860f06ab..7066c038 100644 --- a/data/interfaces/default/js/tables/media_info_table.js +++ b/data/interfaces/default/js/tables/media_info_table.js @@ -199,7 +199,7 @@ media_info_table_options = { }, { "targets": [10], - "data": "last_watched", + "data": "last_played", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== null && cellData !== '') { date = moment(cellData, "X").format(date_format); @@ -427,7 +427,7 @@ function childTableFormatMedia(rowData) { 'Audio Codec' + 'Audio Channels' + 'File Size' + - 'Last Watched' + + 'Last Played' + 'Total Plays' + '' + '' + diff --git a/data/interfaces/default/js/tables/user_ips.js b/data/interfaces/default/js/tables/user_ips.js index 46cbee3a..3cbd6c91 100644 --- a/data/interfaces/default/js/tables/user_ips.js +++ b/data/interfaces/default/js/tables/user_ips.js @@ -81,7 +81,7 @@ user_ip_table_options = { }, { "targets": [4], - "data":"last_watched", + "data":"last_played", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { var media_type = ''; diff --git a/data/interfaces/default/js/tables/users.js b/data/interfaces/default/js/tables/users.js index 80292ec0..1a47439f 100644 --- a/data/interfaces/default/js/tables/users.js +++ b/data/interfaces/default/js/tables/users.js @@ -137,7 +137,7 @@ users_list_table_options = { }, { "targets": [7], - "data":"last_watched", + "data":"last_played", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== null && cellData !== '') { var media_type = ''; diff --git a/data/interfaces/default/libraries.html b/data/interfaces/default/libraries.html index 78697293..526bef5b 100644 --- a/data/interfaces/default/libraries.html +++ b/data/interfaces/default/libraries.html @@ -46,7 +46,7 @@ Total Seasons / Albums Total Episodes / Tracks Last Accessed - Last Watched + Last Played Total Plays diff --git a/data/interfaces/default/library.html b/data/interfaces/default/library.html index 4f75e7fd..ee7162b9 100644 --- a/data/interfaces/default/library.html +++ b/data/interfaces/default/library.html @@ -240,7 +240,7 @@ DOCUMENTATION :: END Audio Codec Audio Channels File Size - Last Watched + Last Played Total Plays diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 15d7e2bb..6432252a 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -145,7 +145,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
  • diff --git a/data/interfaces/default/user.html b/data/interfaces/default/user.html index f5183b95..d8fb0bd5 100644 --- a/data/interfaces/default/user.html +++ b/data/interfaces/default/user.html @@ -147,7 +147,7 @@ from plexpy import helpers IP Address Last Platform Last Player - Last Watched + Last Played Play Count diff --git a/data/interfaces/default/users.html b/data/interfaces/default/users.html index fb2600f3..69c725a2 100644 --- a/data/interfaces/default/users.html +++ b/data/interfaces/default/users.html @@ -30,7 +30,7 @@ Last Known IP Last Platform Last Player - Last Watched + Last Played Total Plays diff --git a/plexpy/libraries.py b/plexpy/libraries.py index 4a6ba97b..01a3b2f5 100644 --- a/plexpy/libraries.py +++ b/plexpy/libraries.py @@ -111,7 +111,7 @@ class Libraries(object): 'COUNT(session_history.id) AS plays', 'MAX(session_history.started) AS last_accessed', 'MAX(session_history.id) AS id', - 'session_history_metadata.full_title AS last_watched', + 'session_history_metadata.full_title AS last_played', 'session_history_metadata.thumb', 'session_history_metadata.parent_thumb', 'session_history_metadata.grandparent_thumb', @@ -174,7 +174,7 @@ class Libraries(object): 'plays': item['plays'], 'last_accessed': item['last_accessed'], 'id': item['id'], - 'last_watched': item['last_watched'], + 'last_played': item['last_played'], 'thumb': thumb, 'media_type': item['media_type'], 'rating_key': item['rating_key'], @@ -236,7 +236,7 @@ class Libraries(object): group_by = 'rating_key' try: - query = 'SELECT MAX(session_history.started) AS last_watched, COUNT(DISTINCT session_history.%s) AS play_count, ' \ + query = 'SELECT MAX(session_history.started) AS last_played, COUNT(DISTINCT session_history.%s) AS play_count, ' \ 'session_history.rating_key, session_history.parent_rating_key, session_history.grandparent_rating_key ' \ 'FROM session_history ' \ 'JOIN session_history_metadata ON session_history.id = session_history_metadata.id ' \ @@ -249,7 +249,7 @@ class Libraries(object): watched_list = {} for item in result: - watched_list[str(item[group_by])] = {'last_watched': item['last_watched'], + watched_list[str(item[group_by])] = {'last_played': item['last_played'], 'play_count': item['play_count']} rows = [] @@ -344,14 +344,14 @@ class Libraries(object): except IOError as e: logger.debug(u"PlexPy Libraries :: Unable to create cache file for section_id %s." % section_id) - # Update the last_watched and play_count + # Update the last_played and play_count for item in rows: watched_item = watched_list.get(item['rating_key'], None) if watched_item: - item['last_watched'] = watched_item['last_watched'] + item['last_played'] = watched_item['last_played'] item['play_count'] = watched_item['play_count'] else: - item['last_watched'] = None + item['last_played'] = None item['play_count'] = None results = [] diff --git a/plexpy/users.py b/plexpy/users.py index a737a811..529d8942 100644 --- a/plexpy/users.py +++ b/plexpy/users.py @@ -34,7 +34,7 @@ class Users(object): 'COUNT(session_history.id) AS plays', 'MAX(session_history.started) AS last_seen', 'MAX(session_history.id) AS id', - 'session_history_metadata.full_title AS last_watched', + 'session_history_metadata.full_title AS last_played', 'session_history.ip_address', 'session_history.platform', 'session_history.player', @@ -97,7 +97,7 @@ class Users(object): 'user_thumb': user_thumb, 'plays': item['plays'], 'last_seen': item['last_seen'], - 'last_watched': item['last_watched'], + 'last_played': item['last_played'], 'id': item['id'], 'ip_address': item['ip_address'], 'platform': platform, @@ -132,7 +132,7 @@ class Users(object): 'COUNT(session_history.id) AS play_count', 'session_history.platform', 'session_history.player', - 'session_history_metadata.full_title AS last_watched', + 'session_history_metadata.full_title AS last_played', 'session_history_metadata.thumb', 'session_history_metadata.parent_thumb', 'session_history_metadata.grandparent_thumb', @@ -188,7 +188,7 @@ class Users(object): 'play_count': item['play_count'], 'platform': platform, 'player': item['player'], - 'last_watched': item['last_watched'], + 'last_played': item['last_played'], 'thumb': thumb, 'media_type': item['media_type'], 'rating_key': item['rating_key'],