mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 01:32:57 -07:00
Fix Local user icon not showing in library user stats
This commit is contained in:
parent
4285b55c15
commit
f7153d0f3b
1 changed files with 10 additions and 2 deletions
|
@ -783,7 +783,8 @@ 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, COUNT(DISTINCT %s) AS user_count ' \
|
||||
'users.user_id, 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 ' \
|
||||
'JOIN users ON users.user_id = session_history.user_id ' \
|
||||
|
@ -798,9 +799,16 @@ class Libraries(object):
|
|||
result = []
|
||||
|
||||
for item in result:
|
||||
if item['custom_thumb'] and item['custom_thumb'] != item['thumb']:
|
||||
user_thumb = item['custom_thumb']
|
||||
elif item['thumb']:
|
||||
user_thumb = item['thumb']
|
||||
else:
|
||||
user_thumb = common.DEFAULT_USER_THUMB
|
||||
|
||||
row = {'friendly_name': item['friendly_name'],
|
||||
'user_id': item['user_id'],
|
||||
'user_thumb': item['thumb'],
|
||||
'user_thumb': user_thumb,
|
||||
'total_plays': item['user_count']
|
||||
}
|
||||
user_stats.append(row)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue