mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Rename last watched to last played
This commit is contained in:
parent
c62e0e4e99
commit
b1ea3bcd4e
12 changed files with 22 additions and 22 deletions
|
@ -692,7 +692,7 @@ DOCUMENTATION :: END
|
||||||
<li>
|
<li>
|
||||||
<div class="home-platforms-instance-info">
|
<div class="home-platforms-instance-info">
|
||||||
<div class="home-platforms-instance-name">
|
<div class="home-platforms-instance-name">
|
||||||
<h4>Last Watched</h4>
|
<h4>Last Played</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="home-platforms-instance-last-user">
|
<div class="home-platforms-instance-last-user">
|
||||||
<h4>
|
<h4>
|
||||||
|
|
|
@ -133,7 +133,7 @@ libraries_list_table_options = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"targets": [8],
|
"targets": [8],
|
||||||
"data":"last_watched",
|
"data":"last_played",
|
||||||
"createdCell": function (td, cellData, rowData, row, col) {
|
"createdCell": function (td, cellData, rowData, row, col) {
|
||||||
if (cellData !== null && cellData !== '') {
|
if (cellData !== null && cellData !== '') {
|
||||||
var media_type = '';
|
var media_type = '';
|
||||||
|
|
|
@ -199,7 +199,7 @@ media_info_table_options = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"targets": [10],
|
"targets": [10],
|
||||||
"data": "last_watched",
|
"data": "last_played",
|
||||||
"createdCell": function (td, cellData, rowData, row, col) {
|
"createdCell": function (td, cellData, rowData, row, col) {
|
||||||
if (cellData !== null && cellData !== '') {
|
if (cellData !== null && cellData !== '') {
|
||||||
date = moment(cellData, "X").format(date_format);
|
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_codec">Audio Codec</th>' +
|
||||||
'<th align="left" id="audio_channels">Audio Channels</th>' +
|
'<th align="left" id="audio_channels">Audio Channels</th>' +
|
||||||
'<th align="left" id="file_size">File Size</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>' +
|
'<th align="left" id="total_plays">Total Plays</th>' +
|
||||||
'</tr>' +
|
'</tr>' +
|
||||||
'</thead>' +
|
'</thead>' +
|
||||||
|
|
|
@ -81,7 +81,7 @@ user_ip_table_options = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"targets": [4],
|
"targets": [4],
|
||||||
"data":"last_watched",
|
"data":"last_played",
|
||||||
"createdCell": function (td, cellData, rowData, row, col) {
|
"createdCell": function (td, cellData, rowData, row, col) {
|
||||||
if (cellData !== '') {
|
if (cellData !== '') {
|
||||||
var media_type = '';
|
var media_type = '';
|
||||||
|
|
|
@ -137,7 +137,7 @@ users_list_table_options = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"targets": [7],
|
"targets": [7],
|
||||||
"data":"last_watched",
|
"data":"last_played",
|
||||||
"createdCell": function (td, cellData, rowData, row, col) {
|
"createdCell": function (td, cellData, rowData, row, col) {
|
||||||
if (cellData !== null && cellData !== '') {
|
if (cellData !== null && cellData !== '') {
|
||||||
var media_type = '';
|
var media_type = '';
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
<th align="left" id="parent_count">Total Seasons / Albums</th>
|
<th align="left" id="parent_count">Total Seasons / Albums</th>
|
||||||
<th align="left" id="child_count">Total Episodes / Tracks</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_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>
|
<th align="left" id="total_plays">Total Plays</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -240,7 +240,7 @@ DOCUMENTATION :: END
|
||||||
<th align="left" id="audio_codec">Audio Codec</th>
|
<th align="left" id="audio_codec">Audio Codec</th>
|
||||||
<th align="left" id="audio_channels">Audio Channels</th>
|
<th align="left" id="audio_channels">Audio Channels</th>
|
||||||
<th align="left" id="file_size">File Size</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>
|
<th align="left" id="total_plays">Total Plays</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -145,7 +145,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
|
||||||
<li class="card card-sortable">
|
<li class="card card-sortable">
|
||||||
<div class="card-handle"><i class="fa fa-bars"></i></div>
|
<div class="card-handle"><i class="fa fa-bars"></i></div>
|
||||||
<label>
|
<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>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li class="card card-sortable">
|
<li class="card card-sortable">
|
||||||
|
|
|
@ -147,7 +147,7 @@ from plexpy import helpers
|
||||||
<th align="left">IP Address</th>
|
<th align="left">IP Address</th>
|
||||||
<th align="left">Last Platform</th>
|
<th align="left">Last Platform</th>
|
||||||
<th align="left">Last Player</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>
|
<th align="left">Play Count</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<th align="left" id="last_known_ip">Last Known IP</th>
|
<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_platform">Last Platform</th>
|
||||||
<th align="left" id="last_player">Last Player</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>
|
<th align="left" id="total_plays">Total Plays</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -111,7 +111,7 @@ class Libraries(object):
|
||||||
'COUNT(session_history.id) AS plays',
|
'COUNT(session_history.id) AS plays',
|
||||||
'MAX(session_history.started) AS last_accessed',
|
'MAX(session_history.started) AS last_accessed',
|
||||||
'MAX(session_history.id) AS id',
|
'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.thumb',
|
||||||
'session_history_metadata.parent_thumb',
|
'session_history_metadata.parent_thumb',
|
||||||
'session_history_metadata.grandparent_thumb',
|
'session_history_metadata.grandparent_thumb',
|
||||||
|
@ -174,7 +174,7 @@ class Libraries(object):
|
||||||
'plays': item['plays'],
|
'plays': item['plays'],
|
||||||
'last_accessed': item['last_accessed'],
|
'last_accessed': item['last_accessed'],
|
||||||
'id': item['id'],
|
'id': item['id'],
|
||||||
'last_watched': item['last_watched'],
|
'last_played': item['last_played'],
|
||||||
'thumb': thumb,
|
'thumb': thumb,
|
||||||
'media_type': item['media_type'],
|
'media_type': item['media_type'],
|
||||||
'rating_key': item['rating_key'],
|
'rating_key': item['rating_key'],
|
||||||
|
@ -236,7 +236,7 @@ class Libraries(object):
|
||||||
group_by = 'rating_key'
|
group_by = 'rating_key'
|
||||||
|
|
||||||
try:
|
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 ' \
|
'session_history.rating_key, session_history.parent_rating_key, session_history.grandparent_rating_key ' \
|
||||||
'FROM session_history ' \
|
'FROM session_history ' \
|
||||||
'JOIN session_history_metadata ON session_history.id = session_history_metadata.id ' \
|
'JOIN session_history_metadata ON session_history.id = session_history_metadata.id ' \
|
||||||
|
@ -249,7 +249,7 @@ class Libraries(object):
|
||||||
|
|
||||||
watched_list = {}
|
watched_list = {}
|
||||||
for item in result:
|
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']}
|
'play_count': item['play_count']}
|
||||||
|
|
||||||
rows = []
|
rows = []
|
||||||
|
@ -344,14 +344,14 @@ class Libraries(object):
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
logger.debug(u"PlexPy Libraries :: Unable to create cache file for section_id %s." % section_id)
|
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:
|
for item in rows:
|
||||||
watched_item = watched_list.get(item['rating_key'], None)
|
watched_item = watched_list.get(item['rating_key'], None)
|
||||||
if watched_item:
|
if watched_item:
|
||||||
item['last_watched'] = watched_item['last_watched']
|
item['last_played'] = watched_item['last_played']
|
||||||
item['play_count'] = watched_item['play_count']
|
item['play_count'] = watched_item['play_count']
|
||||||
else:
|
else:
|
||||||
item['last_watched'] = None
|
item['last_played'] = None
|
||||||
item['play_count'] = None
|
item['play_count'] = None
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Users(object):
|
||||||
'COUNT(session_history.id) AS plays',
|
'COUNT(session_history.id) AS plays',
|
||||||
'MAX(session_history.started) AS last_seen',
|
'MAX(session_history.started) AS last_seen',
|
||||||
'MAX(session_history.id) AS id',
|
'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.ip_address',
|
||||||
'session_history.platform',
|
'session_history.platform',
|
||||||
'session_history.player',
|
'session_history.player',
|
||||||
|
@ -97,7 +97,7 @@ class Users(object):
|
||||||
'user_thumb': user_thumb,
|
'user_thumb': user_thumb,
|
||||||
'plays': item['plays'],
|
'plays': item['plays'],
|
||||||
'last_seen': item['last_seen'],
|
'last_seen': item['last_seen'],
|
||||||
'last_watched': item['last_watched'],
|
'last_played': item['last_played'],
|
||||||
'id': item['id'],
|
'id': item['id'],
|
||||||
'ip_address': item['ip_address'],
|
'ip_address': item['ip_address'],
|
||||||
'platform': platform,
|
'platform': platform,
|
||||||
|
@ -132,7 +132,7 @@ class Users(object):
|
||||||
'COUNT(session_history.id) AS play_count',
|
'COUNT(session_history.id) AS play_count',
|
||||||
'session_history.platform',
|
'session_history.platform',
|
||||||
'session_history.player',
|
'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.thumb',
|
||||||
'session_history_metadata.parent_thumb',
|
'session_history_metadata.parent_thumb',
|
||||||
'session_history_metadata.grandparent_thumb',
|
'session_history_metadata.grandparent_thumb',
|
||||||
|
@ -188,7 +188,7 @@ class Users(object):
|
||||||
'play_count': item['play_count'],
|
'play_count': item['play_count'],
|
||||||
'platform': platform,
|
'platform': platform,
|
||||||
'player': item['player'],
|
'player': item['player'],
|
||||||
'last_watched': item['last_watched'],
|
'last_played': item['last_played'],
|
||||||
'thumb': thumb,
|
'thumb': thumb,
|
||||||
'media_type': item['media_type'],
|
'media_type': item['media_type'],
|
||||||
'rating_key': item['rating_key'],
|
'rating_key': item['rating_key'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue