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

Fix changes in 2bf7a53

This commit is contained in:
ferferga 2020-05-26 14:03:59 +02:00
parent c3ce87ecb2
commit 3637a11a3b

View file

@ -510,12 +510,16 @@ import 'programStyles';
if (options.preferThumb && item.ImageTags && item.ImageTags.Thumb) { if (options.preferThumb && item.ImageTags && item.ImageTags.Thumb) {
imgType = 'Thumb'; imgType = 'Thumb';
imgTag = item.ImageTags.Thumb;
} else if ((options.preferBanner || shape === 'banner') && item.ImageTags && item.ImageTags.Banner) { } else if ((options.preferBanner || shape === 'banner') && item.ImageTags && item.ImageTags.Banner) {
imgType = 'Banner'; imgType = 'Banner';
imgTag = item.ImageTags.Banner;
} else if (options.preferDisc && item.ImageTags && item.ImageTags.Disc) { } else if (options.preferDisc && item.ImageTags && item.ImageTags.Disc) {
imgType = 'Disc'; imgType = 'Disc';
imgTag = item.ImageTags.Disc;
} else if (options.preferLogo && item.ImageTags && item.ImageTags.Logo) { } else if (options.preferLogo && item.ImageTags && item.ImageTags.Logo) {
imgType = 'Logo'; imgType = 'Logo';
imgTag = item.ImageTags.Logo;
} else if (options.preferLogo && item.ParentLogoImageTag && item.ParentLogoItemId) { } else if (options.preferLogo && item.ParentLogoImageTag && item.ParentLogoItemId) {
imgType = 'Logo'; imgType = 'Logo';
imgTag = item.ParentLogoImageTag; imgTag = item.ParentLogoImageTag;
@ -534,6 +538,7 @@ import 'programStyles';
imgTag = item.ParentBackdropImageTags[0]; imgTag = item.ParentBackdropImageTags[0];
} else if (item.ImageTags && item.ImageTags.Primary) { } else if (item.ImageTags && item.ImageTags.Primary) {
imgType = 'Primary'; imgType = 'Primary';
imgTag = item.ImageTags.Primary;
height = width && primaryImageAspectRatio ? Math.round(width / primaryImageAspectRatio) : null; height = width && primaryImageAspectRatio ? Math.round(width / primaryImageAspectRatio) : null;
if (options.preferThumb && options.showTitle !== false) { if (options.preferThumb && options.showTitle !== false) {
@ -581,11 +586,13 @@ import 'programStyles';
} }
} else if (item.Type === 'Season' && item.ImageTags && item.ImageTags.Thumb) { } else if (item.Type === 'Season' && item.ImageTags && item.ImageTags.Thumb) {
imgType = 'Thumb'; imgType = 'Thumb';
imgTag = item.ImageTags.Thumb;
} else if (item.BackdropImageTags && item.BackdropImageTags.length) { } else if (item.BackdropImageTags && item.BackdropImageTags.length) {
imgType = 'Backdrop'; imgType = 'Backdrop';
imgTag = item.BackdropImageTags[0]; imgTag = item.BackdropImageTags[0];
} else if (item.ImageTags && item.ImageTags.Thumb) { } else if (item.ImageTags && item.ImageTags.Thumb) {
imgType = 'Thumb'; imgType = 'Thumb';
imgTag = item.ImageTags.Thumb;
} else if (item.SeriesThumbImageTag && options.inheritThumb !== false) { } else if (item.SeriesThumbImageTag && options.inheritThumb !== false) {
imgType = 'Thumb'; imgType = 'Thumb';
imgTag = item.SeriesThumbImageTag; imgTag = item.SeriesThumbImageTag;
@ -601,12 +608,12 @@ import 'programStyles';
type: imgType, type: imgType,
maxHeight: height, maxHeight: height,
maxWidth: width, maxWidth: width,
tag: imgTag || item.ImageTags[imgType] tag: imgTag
}); });
return { return {
imgUrl: imgUrl, imgUrl: imgUrl,
blurhash: (item.ImageBlurHashes || {})[imgType], blurhash: item.ImageBlurHashes[imgTag] || null,
forceName: forceName, forceName: forceName,
coverImage: coverImage coverImage: coverImage
}; };