1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

use album images when songs don't have their own

This commit is contained in:
Luke Pulverenti 2013-07-18 10:59:58 -04:00
parent 5e16365576
commit 2571219073

View file

@ -47,6 +47,8 @@
var imgUrl = null; var imgUrl = null;
var isDefault = false; var isDefault = false;
var height = null;
var width = null;
var cssClass = "tileItem"; var cssClass = "tileItem";
@ -75,14 +77,27 @@
} }
else if (item.ImageTags && item.ImageTags.Primary) { else if (item.ImageTags && item.ImageTags.Primary) {
var height = 300; height = 300;
var width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null; width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null;
imgUrl = LibraryBrowser.getImageUrl(item, 'Primary', 0, { imgUrl = LibraryBrowser.getImageUrl(item, 'Primary', 0, {
height: height, height: height,
width: width width: width
}); });
}
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
});
} }
else if (item.BackdropImageTags && item.BackdropImageTags.length) { else if (item.BackdropImageTags && item.BackdropImageTags.length) {
@ -455,6 +470,8 @@
var imgUrl = null; var imgUrl = null;
var background = null; var background = null;
var width = null;
var height = null;
if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) { if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) {
@ -467,8 +484,8 @@
} else if (item.ImageTags && item.ImageTags.Primary) { } else if (item.ImageTags && item.ImageTags.Primary) {
var height = 300; height = 300;
var width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null; width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null;
imgUrl = ApiClient.getImageUrl(item.Id, { imgUrl = ApiClient.getImageUrl(item.Id, {
type: "Primary", type: "Primary",
@ -477,7 +494,21 @@
tag: item.ImageTags.Primary tag: item.ImageTags.Primary
}); });
} else if (item.BackdropImageTags && item.BackdropImageTags.length) { }
else if (item.AlbumId && item.AlbumPrimaryImageTag) {
height = 300;
width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null;
imgUrl = ApiClient.getImageUrl(item.AlbumId, {
type: "Primary",
height: height,
width: width,
tag: item.AlbumPrimaryImageTag
});
}
else if (item.BackdropImageTags && item.BackdropImageTags.length) {
imgUrl = ApiClient.getImageUrl(item.Id, { imgUrl = ApiClient.getImageUrl(item.Id, {
type: "Backdrop", type: "Backdrop",
@ -1348,6 +1379,15 @@
tag: item.ImageTags.Disc tag: item.ImageTags.Disc
}); });
} }
else if (item.AlbumId && item.AlbumPrimaryImageTag) {
url = ApiClient.getImageUrl(item.AlbumId, {
type: "Primary",
maxheight: 480,
tag: item.AlbumPrimaryImageTag
});
}
else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicGenre") { else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicGenre") {
url = "css/images/items/detail/audio.png"; url = "css/images/items/detail/audio.png";
} }