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,
|
cache: false,
|
||||||
async: true,
|
async: true,
|
||||||
success: function(data) {
|
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) {
|
complete: function (data) {
|
||||||
showMsg('<i class="fa fa-exclamation-circle"></i> Unable to refresh user list.',false,true,2000,true)
|
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]
|
custom_where = ['users.deleted_user', 0]
|
||||||
|
|
||||||
columns = ['session_history.id',
|
columns = ['users.user_id as user_id',
|
||||||
'users.user_id as user_id',
|
|
||||||
'users.custom_avatar_url as user_thumb',
|
'users.custom_avatar_url as user_thumb',
|
||||||
'(case when users.friendly_name is null then users.username else \
|
'(case when users.friendly_name is null then users.username else \
|
||||||
users.friendly_name end) as friendly_name',
|
users.friendly_name end) as friendly_name',
|
||||||
|
@ -74,12 +73,12 @@ class Users(object):
|
||||||
|
|
||||||
rows = []
|
rows = []
|
||||||
for item in users:
|
for item in users:
|
||||||
if item["media_type"] == 'episode' and item["parent_thumb"]:
|
if item['media_type'] == 'episode' and item['parent_thumb']:
|
||||||
thumb = item["parent_thumb"]
|
thumb = item['parent_thumb']
|
||||||
elif item["media_type"] == 'episode':
|
elif item['media_type'] == 'episode':
|
||||||
thumb = item["grandparent_thumb"]
|
thumb = item['grandparent_thumb']
|
||||||
else:
|
else:
|
||||||
thumb = item["thumb"]
|
thumb = item['thumb']
|
||||||
|
|
||||||
if not item['user_thumb'] or item['user_thumb'] == '':
|
if not item['user_thumb'] or item['user_thumb'] == '':
|
||||||
user_thumb = common.DEFAULT_USER_THUMB
|
user_thumb = common.DEFAULT_USER_THUMB
|
||||||
|
@ -87,25 +86,24 @@ class Users(object):
|
||||||
user_thumb = item['user_thumb']
|
user_thumb = item['user_thumb']
|
||||||
|
|
||||||
# Rename Mystery platform names
|
# 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'],
|
row = {'plays': item['plays'],
|
||||||
"plays": item['plays'],
|
'last_seen': item['last_seen'],
|
||||||
"last_seen": item['last_seen'],
|
'friendly_name': item['friendly_name'],
|
||||||
"friendly_name": item['friendly_name'],
|
'ip_address': item['ip_address'],
|
||||||
"ip_address": item['ip_address'],
|
'platform': platform,
|
||||||
"platform": platform,
|
'player': item['player'],
|
||||||
"player": item["player"],
|
'last_watched': item['last_watched'],
|
||||||
"last_watched": item['last_watched'],
|
'thumb': thumb,
|
||||||
"thumb": thumb,
|
'media_type': item['media_type'],
|
||||||
"media_type": item['media_type'],
|
'rating_key': item['rating_key'],
|
||||||
"rating_key": item['rating_key'],
|
'video_decision': item['video_decision'],
|
||||||
"video_decision": item['video_decision'],
|
'user_thumb': user_thumb,
|
||||||
"user_thumb": user_thumb,
|
'user': item['user'],
|
||||||
"user": item["user"],
|
'user_id': item['user_id'],
|
||||||
"user_id": item['user_id'],
|
'do_notify': helpers.checked(item['do_notify']),
|
||||||
"do_notify": helpers.checked(item['do_notify']),
|
'keep_history': helpers.checked(item['keep_history'])
|
||||||
"keep_history": helpers.checked(item['keep_history'])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rows.append(row)
|
rows.append(row)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue