mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 23:42:37 -07:00
Clean up users page to match libraries page
This commit is contained in:
parent
a5b0837cf5
commit
979d68957e
2 changed files with 29 additions and 28 deletions
|
@ -177,10 +177,13 @@
|
|||
cache: false,
|
||||
async: true,
|
||||
success: function(data) {
|
||||
showMsg('<i class="fa fa-check"></i> User list refresh started...',false,true,2000,false)
|
||||
showMsg('<i class="fa fa-check"></i> Users list refresh started...',false,true,2000,false)
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
showMsg('<i class="fa fa-exclamation-circle"></i> Unable to refresh user list.',false,true,2000,true)
|
||||
complete: function (data) {
|
||||
showMsg('<i class="fa fa-check"></i> Users list refreshed.', false, true, 2000, false)
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
showMsg('<i class="fa fa-exclamation-circle"></i> Unable to refresh users list.',false,true,2000,true)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -26,8 +26,7 @@ class Users(object):
|
|||
|
||||
custom_where = ['users.deleted_user', 0]
|
||||
|
||||
columns = ['session_history.id',
|
||||
'users.user_id as user_id',
|
||||
columns = ['users.user_id as user_id',
|
||||
'users.custom_avatar_url as user_thumb',
|
||||
'(case when users.friendly_name is null then users.username else \
|
||||
users.friendly_name end) as friendly_name',
|
||||
|
@ -74,12 +73,12 @@ class Users(object):
|
|||
|
||||
rows = []
|
||||
for item in users:
|
||||
if item["media_type"] == 'episode' and item["parent_thumb"]:
|
||||
thumb = item["parent_thumb"]
|
||||
elif item["media_type"] == 'episode':
|
||||
thumb = item["grandparent_thumb"]
|
||||
if item['media_type'] == 'episode' and item['parent_thumb']:
|
||||
thumb = item['parent_thumb']
|
||||
elif item['media_type'] == 'episode':
|
||||
thumb = item['grandparent_thumb']
|
||||
else:
|
||||
thumb = item["thumb"]
|
||||
thumb = item['thumb']
|
||||
|
||||
if not item['user_thumb'] or item['user_thumb'] == '':
|
||||
user_thumb = common.DEFAULT_USER_THUMB
|
||||
|
@ -87,25 +86,24 @@ class Users(object):
|
|||
user_thumb = item['user_thumb']
|
||||
|
||||
# Rename Mystery platform names
|
||||
platform = common.PLATFORM_NAME_OVERRIDES.get(item["platform"], item["platform"])
|
||||
platform = common.PLATFORM_NAME_OVERRIDES.get(item['platform'], item['platform'])
|
||||
|
||||
row = {"id": item['id'],
|
||||
"plays": item['plays'],
|
||||
"last_seen": item['last_seen'],
|
||||
"friendly_name": item['friendly_name'],
|
||||
"ip_address": item['ip_address'],
|
||||
"platform": platform,
|
||||
"player": item["player"],
|
||||
"last_watched": item['last_watched'],
|
||||
"thumb": thumb,
|
||||
"media_type": item['media_type'],
|
||||
"rating_key": item['rating_key'],
|
||||
"video_decision": item['video_decision'],
|
||||
"user_thumb": user_thumb,
|
||||
"user": item["user"],
|
||||
"user_id": item['user_id'],
|
||||
"do_notify": helpers.checked(item['do_notify']),
|
||||
"keep_history": helpers.checked(item['keep_history'])
|
||||
row = {'plays': item['plays'],
|
||||
'last_seen': item['last_seen'],
|
||||
'friendly_name': item['friendly_name'],
|
||||
'ip_address': item['ip_address'],
|
||||
'platform': platform,
|
||||
'player': item['player'],
|
||||
'last_watched': item['last_watched'],
|
||||
'thumb': thumb,
|
||||
'media_type': item['media_type'],
|
||||
'rating_key': item['rating_key'],
|
||||
'video_decision': item['video_decision'],
|
||||
'user_thumb': user_thumb,
|
||||
'user': item['user'],
|
||||
'user_id': item['user_id'],
|
||||
'do_notify': helpers.checked(item['do_notify']),
|
||||
'keep_history': helpers.checked(item['keep_history'])
|
||||
}
|
||||
|
||||
rows.append(row)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue