mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Round every image size adjustment
This commit is contained in:
parent
f24c908412
commit
0397283599
4 changed files with 23 additions and 23 deletions
|
@ -636,7 +636,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
getNowPlayingImageUrl: function (item) {
|
getNowPlayingImageUrl: function (item) {
|
||||||
if (item && item.BackdropImageTags && item.BackdropImageTags.length) {
|
if (item && item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||||
return ApiClient.getScaledImageUrl(item.Id, {
|
return ApiClient.getScaledImageUrl(item.Id, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Backdrop",
|
type: "Backdrop",
|
||||||
tag: item.BackdropImageTags[0]
|
tag: item.BackdropImageTags[0]
|
||||||
});
|
});
|
||||||
|
@ -644,7 +644,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
|
|
||||||
if (item && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
|
if (item && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
|
||||||
return ApiClient.getScaledImageUrl(item.ParentBackdropItemId, {
|
return ApiClient.getScaledImageUrl(item.ParentBackdropItemId, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Backdrop",
|
type: "Backdrop",
|
||||||
tag: item.ParentBackdropImageTags[0]
|
tag: item.ParentBackdropImageTags[0]
|
||||||
});
|
});
|
||||||
|
@ -652,7 +652,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
|
|
||||||
if (item && item.BackdropImageTag) {
|
if (item && item.BackdropImageTag) {
|
||||||
return ApiClient.getScaledImageUrl(item.BackdropItemId, {
|
return ApiClient.getScaledImageUrl(item.BackdropItemId, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Backdrop",
|
type: "Backdrop",
|
||||||
tag: item.BackdropImageTag
|
tag: item.BackdropImageTag
|
||||||
});
|
});
|
||||||
|
@ -662,7 +662,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
|
|
||||||
if (item && imageTags.Thumb) {
|
if (item && imageTags.Thumb) {
|
||||||
return ApiClient.getScaledImageUrl(item.Id, {
|
return ApiClient.getScaledImageUrl(item.Id, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Thumb",
|
type: "Thumb",
|
||||||
tag: imageTags.Thumb
|
tag: imageTags.Thumb
|
||||||
});
|
});
|
||||||
|
@ -670,7 +670,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
|
|
||||||
if (item && item.ParentThumbImageTag) {
|
if (item && item.ParentThumbImageTag) {
|
||||||
return ApiClient.getScaledImageUrl(item.ParentThumbItemId, {
|
return ApiClient.getScaledImageUrl(item.ParentThumbItemId, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Thumb",
|
type: "Thumb",
|
||||||
tag: item.ParentThumbImageTag
|
tag: item.ParentThumbImageTag
|
||||||
});
|
});
|
||||||
|
@ -678,7 +678,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
|
|
||||||
if (item && item.ThumbImageTag) {
|
if (item && item.ThumbImageTag) {
|
||||||
return ApiClient.getScaledImageUrl(item.ThumbItemId, {
|
return ApiClient.getScaledImageUrl(item.ThumbItemId, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Thumb",
|
type: "Thumb",
|
||||||
tag: item.ThumbImageTag
|
tag: item.ThumbImageTag
|
||||||
});
|
});
|
||||||
|
@ -686,7 +686,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
|
|
||||||
if (item && imageTags.Primary) {
|
if (item && imageTags.Primary) {
|
||||||
return ApiClient.getScaledImageUrl(item.Id, {
|
return ApiClient.getScaledImageUrl(item.Id, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Primary",
|
type: "Primary",
|
||||||
tag: imageTags.Primary
|
tag: imageTags.Primary
|
||||||
});
|
});
|
||||||
|
@ -694,7 +694,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
|
|
||||||
if (item && item.PrimaryImageTag) {
|
if (item && item.PrimaryImageTag) {
|
||||||
return ApiClient.getScaledImageUrl(item.PrimaryImageItemId, {
|
return ApiClient.getScaledImageUrl(item.PrimaryImageItemId, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Primary",
|
type: "Primary",
|
||||||
tag: item.PrimaryImageTag
|
tag: item.PrimaryImageTag
|
||||||
});
|
});
|
||||||
|
@ -702,7 +702,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
|
||||||
|
|
||||||
if (item && item.AlbumPrimaryImageTag) {
|
if (item && item.AlbumPrimaryImageTag) {
|
||||||
return ApiClient.getScaledImageUrl(item.AlbumId, {
|
return ApiClient.getScaledImageUrl(item.AlbumId, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Primary",
|
type: "Primary",
|
||||||
tag: item.AlbumPrimaryImageTag
|
tag: item.AlbumPrimaryImageTag
|
||||||
});
|
});
|
||||||
|
|
|
@ -770,48 +770,48 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "userSetti
|
||||||
if (imageTags.Primary) {
|
if (imageTags.Primary) {
|
||||||
url = apiClient.getScaledImageUrl(item.Id, {
|
url = apiClient.getScaledImageUrl(item.Id, {
|
||||||
type: "Primary",
|
type: "Primary",
|
||||||
maxWidth: dom.getScreenWidth() * 0.5,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.5),
|
||||||
tag: item.ImageTags.Primary
|
tag: item.ImageTags.Primary
|
||||||
});
|
});
|
||||||
detectRatio = true;
|
detectRatio = true;
|
||||||
} else if (item.BackdropImageTags && item.BackdropImageTags.length) {
|
} else if (item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||||
url = apiClient.getScaledImageUrl(item.Id, {
|
url = apiClient.getScaledImageUrl(item.Id, {
|
||||||
type: "Backdrop",
|
type: "Backdrop",
|
||||||
maxWidth: dom.getScreenWidth() * 0.5,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.5),
|
||||||
tag: item.BackdropImageTags[0]
|
tag: item.BackdropImageTags[0]
|
||||||
});
|
});
|
||||||
shape = "thumb";
|
shape = "thumb";
|
||||||
} else if (imageTags.Thumb) {
|
} else if (imageTags.Thumb) {
|
||||||
url = apiClient.getScaledImageUrl(item.Id, {
|
url = apiClient.getScaledImageUrl(item.Id, {
|
||||||
type: "Thumb",
|
type: "Thumb",
|
||||||
maxWidth: dom.getScreenWidth() * 0.5,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.5),
|
||||||
tag: item.ImageTags.Thumb
|
tag: item.ImageTags.Thumb
|
||||||
});
|
});
|
||||||
shape = "thumb";
|
shape = "thumb";
|
||||||
} else if (imageTags.Disc) {
|
} else if (imageTags.Disc) {
|
||||||
url = apiClient.getScaledImageUrl(item.Id, {
|
url = apiClient.getScaledImageUrl(item.Id, {
|
||||||
type: "Disc",
|
type: "Disc",
|
||||||
maxWidth: dom.getScreenWidth() * 0.5,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.5),
|
||||||
tag: item.ImageTags.Disc
|
tag: item.ImageTags.Disc
|
||||||
});
|
});
|
||||||
shape = "square";
|
shape = "square";
|
||||||
} else if (item.AlbumId && item.AlbumPrimaryImageTag) {
|
} else if (item.AlbumId && item.AlbumPrimaryImageTag) {
|
||||||
url = apiClient.getScaledImageUrl(item.AlbumId, {
|
url = apiClient.getScaledImageUrl(item.AlbumId, {
|
||||||
type: "Primary",
|
type: "Primary",
|
||||||
maxWidth: dom.getScreenWidth() * 0.5,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.5),
|
||||||
tag: item.AlbumPrimaryImageTag
|
tag: item.AlbumPrimaryImageTag
|
||||||
});
|
});
|
||||||
shape = "square";
|
shape = "square";
|
||||||
} else if (item.SeriesId && item.SeriesPrimaryImageTag) {
|
} else if (item.SeriesId && item.SeriesPrimaryImageTag) {
|
||||||
url = apiClient.getScaledImageUrl(item.SeriesId, {
|
url = apiClient.getScaledImageUrl(item.SeriesId, {
|
||||||
type: "Primary",
|
type: "Primary",
|
||||||
maxWidth: dom.getScreenWidth() * 0.5,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.5),
|
||||||
tag: item.SeriesPrimaryImageTag
|
tag: item.SeriesPrimaryImageTag
|
||||||
});
|
});
|
||||||
} else if (item.ParentPrimaryImageItemId && item.ParentPrimaryImageTag) {
|
} else if (item.ParentPrimaryImageItemId && item.ParentPrimaryImageTag) {
|
||||||
url = apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId, {
|
url = apiClient.getScaledImageUrl(item.ParentPrimaryImageItemId, {
|
||||||
type: "Primary",
|
type: "Primary",
|
||||||
maxWidth: dom.getScreenWidth() * 0.5,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.5),
|
||||||
tag: item.ParentPrimaryImageTag
|
tag: item.ParentPrimaryImageTag
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,7 +256,7 @@ define(["jQuery", "apphost", "scripts/taskbutton", "loading", "libraryMenu", "gl
|
||||||
|
|
||||||
if (virtualFolder.PrimaryImageItemId) {
|
if (virtualFolder.PrimaryImageItemId) {
|
||||||
imgUrl = ApiClient.getScaledImageUrl(virtualFolder.PrimaryImageItemId, {
|
imgUrl = ApiClient.getScaledImageUrl(virtualFolder.PrimaryImageItemId, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.40,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.40),
|
||||||
type: "Primary"
|
type: "Primary"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,24 +334,24 @@ define(["playbackManager", "dom", "inputManager", "datetime", "itemHelper", "med
|
||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
var imgUrl = seriesImageUrl(item, {
|
var imgUrl = seriesImageUrl(item, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Primary"
|
type: "Primary"
|
||||||
}) || seriesImageUrl(item, {
|
}) || seriesImageUrl(item, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Thumb"
|
type: "Thumb"
|
||||||
}) || imageUrl(item, {
|
}) || imageUrl(item, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Primary"
|
type: "Primary"
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!imgUrl && secondaryItem && (imgUrl = seriesImageUrl(secondaryItem, {
|
if (!imgUrl && secondaryItem && (imgUrl = seriesImageUrl(secondaryItem, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Primary"
|
type: "Primary"
|
||||||
}) || seriesImageUrl(secondaryItem, {
|
}) || seriesImageUrl(secondaryItem, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Thumb"
|
type: "Thumb"
|
||||||
}) || imageUrl(secondaryItem, {
|
}) || imageUrl(secondaryItem, {
|
||||||
maxWidth: dom.getScreenWidth() * 0.20,
|
maxWidth: Math.round(dom.getScreenWidth() * 0.20),
|
||||||
type: "Primary"
|
type: "Primary"
|
||||||
})), imgUrl) {
|
})), imgUrl) {
|
||||||
return void (osdPoster.innerHTML = '<img src="' + imgUrl + '" />');
|
return void (osdPoster.innerHTML = '<img src="' + imgUrl + '" />');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue