Change friendly name hover title text to username

This commit is contained in:
JonnyWong16 2020-09-29 20:07:23 -07:00
parent d9ece291b7
commit e3eca5af46
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
10 changed files with 25 additions and 16 deletions

View file

@ -791,7 +791,7 @@ class Libraries(object):
if str(section_id).isdigit():
query = 'SELECT (CASE WHEN users.friendly_name IS NULL OR TRIM(users.friendly_name) = "" ' \
'THEN users.username ELSE users.friendly_name END) AS friendly_name, ' \
'users.user_id, users.thumb, users.custom_avatar_url AS custom_thumb, ' \
'users.user_id, users.username, users.thumb, users.custom_avatar_url AS custom_thumb, ' \
'COUNT(DISTINCT %s) AS user_count ' \
'FROM session_history ' \
'JOIN session_history_metadata ON session_history_metadata.id = session_history.id ' \
@ -817,6 +817,7 @@ class Libraries(object):
row = {'friendly_name': item['friendly_name'],
'user_id': item['user_id'],
'user_thumb': user_thumb,
'username': item['username'],
'total_plays': item['user_count']
}
user_stats.append(row)

View file

@ -118,6 +118,7 @@ class Users(object):
columns = ['users.id AS row_id',
'users.user_id',
'users.username',
'(CASE WHEN users.friendly_name IS NULL OR TRIM(users.friendly_name) = "" \
THEN users.username ELSE users.friendly_name END) AS friendly_name',
'users.thumb AS user_thumb',
@ -193,6 +194,7 @@ class Users(object):
row = {'row_id': item['row_id'],
'user_id': item['user_id'],
'username': item['username'],
'friendly_name': item['friendly_name'],
'user_thumb': user_thumb,
'plays': item['plays'],

View file

@ -982,12 +982,14 @@ class WebInterface(object):
[{"friendly_name": "Jon Snow",
"total_plays": 170,
"user_id": 133788,
"user_thumb": "https://plex.tv/users/k10w42309cynaopq/avatar"
"user_thumb": "https://plex.tv/users/k10w42309cynaopq/avatar",
"username": "LordCommanderSnow"
},
{"platform_type": "DanyKhaleesi69",
{"friendly_name": "DanyKhaleesi69",
"total_plays": 42,
"user_id": 8008135,
"user_thumb": "https://plex.tv/users/568gwwoib5t98a3a/avatar"
"user_thumb": "https://plex.tv/users/568gwwoib5t98a3a/avatar",
"username: "DanyKhaleesi69"
},
{...},
{...}
@ -1200,6 +1202,7 @@ class WebInterface(object):
"transcode_decision": "transcode",
"user_id": 133788,
"user_thumb": "https://plex.tv/users/568gwwoib5t98a3a/avatar",
"username": "LordCommanderSnow",
"year": 2016
},
{...},