mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
improve user image resolution
This commit is contained in:
parent
4ae4c4e71a
commit
1ad8c6e955
4 changed files with 26 additions and 6 deletions
|
@ -50,7 +50,7 @@
|
|||
var url = user.imageUrl;
|
||||
|
||||
if (user.supportsImageParams) {
|
||||
url += "&height=" + userButtonHeight;
|
||||
url += "&height=" + (userButtonHeight * Math.max(devicePixelRatio || 1, 2));
|
||||
}
|
||||
|
||||
html += '<img src="' + url + '" style="border-radius: 1000px; height:' + userButtonHeight + 'px;" />';
|
||||
|
@ -253,7 +253,7 @@
|
|||
|
||||
html += '<div class="sidebarLinks librarySidebarLinks">';
|
||||
|
||||
html += '<a style="margin-top:0;padding-left:1em;display:block;color:#fff;text-decoration:none;font-size:16px;font-weight:400!important;background: #000;" href="mypreferencesdisplay.html?userId=' + Dashboard.getCurrentUserId() + '">';
|
||||
html += '<a style="margin-top:0;padding-left:.6em;display:block;color:#fff;text-decoration:none;font-size:16px;font-weight:400!important;background: #000;" href="mypreferencesdisplay.html?userId=' + Dashboard.getCurrentUserId() + '">';
|
||||
|
||||
var imgWidth = 48;
|
||||
|
||||
|
@ -261,10 +261,10 @@
|
|||
var url = user.imageUrl;
|
||||
|
||||
if (user.supportsImageParams) {
|
||||
url += "&width=" + imgWidth;
|
||||
url += "&width=" + (imgWidth * Math.max(devicePixelRatio || 1, 2));
|
||||
}
|
||||
|
||||
html += '<img style="max-width:' + imgWidth + 'px;vertical-align:middle;margin-right:.75em;border-radius: 50px;" src="' + url + '" />';
|
||||
html += '<img style="max-width:' + imgWidth + 'px;vertical-align:middle;margin-right:.8em;border-radius: 50px;" src="' + url + '" />';
|
||||
}
|
||||
html += user.name;
|
||||
html += '</a>';
|
||||
|
|
|
@ -583,7 +583,7 @@ var Dashboard = {
|
|||
var url = user.imageUrl;
|
||||
|
||||
if (user.supportsImageParams) {
|
||||
url += "&width=" + imgWidth;
|
||||
url += "&width=" + (imgWidth * Math.max(devicePixelRatio || 1, 2));
|
||||
}
|
||||
|
||||
html += '<img style="max-width:' + imgWidth + 'px;vertical-align:middle;margin-right:.5em;border-radius: 50px;" src="' + url + '" />';
|
||||
|
|
20
dashboard-ui/thirdparty/apiclient/apiclient.js
vendored
20
dashboard-ui/thirdparty/apiclient/apiclient.js
vendored
|
@ -54,6 +54,25 @@
|
|||
return serverInfo;
|
||||
};
|
||||
|
||||
var currentUser;
|
||||
/**
|
||||
* Gets or sets the current user id.
|
||||
*/
|
||||
self.getCurrentUser = function () {
|
||||
|
||||
if (currentUser != null) {
|
||||
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
deferred.resolveWith(null, [currentUser]);
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
return self.getUser(self.getCurrentUserId()).done(function (user) {
|
||||
|
||||
currentUser = user;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets or sets the current user id.
|
||||
*/
|
||||
|
@ -69,6 +88,7 @@
|
|||
self.setCurrentUserId = function (userId, token) {
|
||||
|
||||
currentUserId = userId;
|
||||
currentUser = null;
|
||||
accessToken = token;
|
||||
};
|
||||
|
||||
|
|
|
@ -433,7 +433,7 @@
|
|||
|
||||
var apiClient = self.currentApiClient();
|
||||
if (apiClient && apiClient.getCurrentUserId()) {
|
||||
apiClient.getUser(apiClient.getCurrentUserId()).done(function (u) {
|
||||
apiClient.getCurrentUser().done(function (u) {
|
||||
localUser = u;
|
||||
}).always(onLocalUserDone);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue