Rename last watched to last played

This commit is contained in:
JonnyWong16 2016-01-23 14:06:25 -08:00
parent c62e0e4e99
commit b1ea3bcd4e
12 changed files with 22 additions and 22 deletions

View file

@ -692,7 +692,7 @@ DOCUMENTATION :: END
<li>
<div class="home-platforms-instance-info">
<div class="home-platforms-instance-name">
<h4>Last Watched</h4>
<h4>Last Played</h4>
</div>
<div class="home-platforms-instance-last-user">
<h4>

View file

@ -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 = '';

View file

@ -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) {
'<th align="left" id="audio_codec">Audio Codec</th>' +
'<th align="left" id="audio_channels">Audio Channels</th>' +
'<th align="left" id="file_size">File Size</th>' +
'<th align="left" id="last_watched">Last Watched</th>' +
'<th align="left" id="last_played">Last Played</th>' +
'<th align="left" id="total_plays">Total Plays</th>' +
'</tr>' +
'</thead>' +

View file

@ -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 = '';

View file

@ -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 = '';

View file

@ -46,7 +46,7 @@
<th align="left" id="parent_count">Total Seasons / Albums</th>
<th align="left" id="child_count">Total Episodes / Tracks</th>
<th align="left" id="last_accessed">Last Accessed</th>
<th align="left" id="last_watched">Last Watched</th>
<th align="left" id="last_played">Last Played</th>
<th align="left" id="total_plays">Total Plays</th>
</tr>
</thead>

View file

@ -240,7 +240,7 @@ DOCUMENTATION :: END
<th align="left" id="audio_codec">Audio Codec</th>
<th align="left" id="audio_channels">Audio Channels</th>
<th align="left" id="file_size">File Size</th>
<th align="left" id="last_watched">Last Watched</th>
<th align="left" id="last_played">Last Played</th>
<th align="left" id="total_plays">Total Plays</th>
</tr>
</thead>

View file

@ -145,7 +145,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<li class="card card-sortable">
<div class="card-handle"><i class="fa fa-bars"></i></div>
<label>
<input type="checkbox" id="hscard-last_watched" name="hscard-last_watched" value="last_watched"> Last Watched
<input type="checkbox" id="hscard-last_watched" name="hscard-last_watched" value="last_watched"> Last Played
</label>
</li>
<li class="card card-sortable">

View file

@ -147,7 +147,7 @@ from plexpy import helpers
<th align="left">IP Address</th>
<th align="left">Last Platform</th>
<th align="left">Last Player</th>
<th align="left">Last Watched</th>
<th align="left">Last Played</th>
<th align="left">Play Count</th>
</tr>
</thead>

View file

@ -30,7 +30,7 @@
<th align="left" id="last_known_ip">Last Known IP</th>
<th align="left" id="last_platform">Last Platform</th>
<th align="left" id="last_player">Last Player</th>
<th align="left" id="last_watched">Last Watched</th>
<th align="left" id="last_played">Last Played</th>
<th align="left" id="total_plays">Total Plays</th>
</tr>
</thead>

View file

@ -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 = []

View file

@ -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'],