mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
make web client images more efficient by using max height instead of height
This commit is contained in:
parent
25cb195ec6
commit
144ee15789
5 changed files with 47 additions and 34 deletions
|
@ -66,8 +66,6 @@
|
|||
options.shape = options.preferBackdrop ? "backdrop" : "poster";
|
||||
}
|
||||
|
||||
var primaryImageAspectRatio = options.useAverageAspectRatio ? LibraryBrowser.getAveragePrimaryImageAspectRatio(items) : null;
|
||||
|
||||
var html = '';
|
||||
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
|
@ -87,7 +85,6 @@
|
|||
var imgUrl = null;
|
||||
var isDefault = false;
|
||||
var height = null;
|
||||
var width = null;
|
||||
|
||||
var cssClass = "tileItem";
|
||||
|
||||
|
@ -117,23 +114,19 @@
|
|||
else if (item.ImageTags && item.ImageTags.Primary) {
|
||||
|
||||
height = 300;
|
||||
width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null;
|
||||
|
||||
imgUrl = LibraryBrowser.getImageUrl(item, 'Primary', 0, {
|
||||
height: height,
|
||||
width: width
|
||||
maxheight: height
|
||||
});
|
||||
|
||||
}
|
||||
else if (item.AlbumId && item.AlbumPrimaryImageTag) {
|
||||
|
||||
height = 300;
|
||||
width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null;
|
||||
|
||||
imgUrl = ApiClient.getImageUrl(item.AlbumId, {
|
||||
type: "Primary",
|
||||
height: 100,
|
||||
width: width,
|
||||
tag: item.AlbumPrimaryImageTag
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue