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

Fix Parent Thumb Image for NextUp And Resume

This commit is contained in:
grafixeyehero 2024-06-23 00:55:23 +03:00
parent f57b3a6355
commit 00de25eccf
2 changed files with 15 additions and 11 deletions

View file

@ -38,12 +38,12 @@ function getPreferThumbInfo(item: ItemDto, cardOptions: CardOptions) {
} else if ( } else if (
item.ParentBackdropImageTags?.length item.ParentBackdropImageTags?.length
&& cardOptions.inheritThumb !== false && cardOptions.inheritThumb !== false
&& item.Type === BaseItemKind.Episode
) { ) {
imgType = ImageType.Backdrop; imgType = ImageType.Backdrop;
imgTag = item.ParentBackdropImageTags[0]; imgTag = item.ParentBackdropImageTags[0];
itemId = item.ParentBackdropItemId; itemId = item.ParentBackdropItemId;
} }
return { return {
itemId: itemId, itemId: itemId,
imgTag: imgTag, imgTag: imgTag,
@ -139,11 +139,11 @@ function shouldShowParentThumbImageTag(
cardOptions: CardOptions cardOptions: CardOptions
): boolean { ): boolean {
return ( return (
Boolean(itemParentThumbItemId) && cardOptions.inheritThumb !== false Boolean(itemParentThumbItemId) && Boolean(cardOptions.inheritThumb)
); );
} }
function shouldShowParentBackdropImageTags(item: ItemDto): boolean { function shouldShowAlbumPrimaryImageTag(item: ItemDto): boolean {
return Boolean(item.AlbumId) && Boolean(item.AlbumPrimaryImageTag); return Boolean(item.AlbumId) && Boolean(item.AlbumPrimaryImageTag);
} }
@ -185,6 +185,10 @@ function getCardImageInfo(
imgType = preferLogoInfo.imgType; imgType = preferLogoInfo.imgType;
imgTag = preferLogoInfo.imgType; imgTag = preferLogoInfo.imgType;
itemId = preferLogoInfo.itemId; itemId = preferLogoInfo.itemId;
} else if (shouldShowParentThumbImageTag(item.ParentThumbItemId, cardOptions)) {
imgType = ImageType.Thumb;
imgTag = item.ParentThumbImageTag;
itemId = item.ParentThumbItemId;
} else if (shouldShowImageTagsPrimary(item)) { } else if (shouldShowImageTagsPrimary(item)) {
imgType = ImageType.Primary; imgType = ImageType.Primary;
imgTag = item.ImageTags?.Primary; imgTag = item.ImageTags?.Primary;
@ -207,7 +211,7 @@ function getCardImageInfo(
imgType = ImageType.Primary; imgType = ImageType.Primary;
imgTag = item.ParentPrimaryImageTag; imgTag = item.ParentPrimaryImageTag;
itemId = item.ParentPrimaryImageItemId; itemId = item.ParentPrimaryImageItemId;
} else if (shouldShowParentBackdropImageTags(item)) { } else if (shouldShowAlbumPrimaryImageTag(item)) {
imgType = ImageType.Primary; imgType = ImageType.Primary;
imgTag = item.AlbumPrimaryImageTag; imgTag = item.AlbumPrimaryImageTag;
itemId = item.AlbumId; itemId = item.AlbumId;
@ -226,10 +230,6 @@ function getCardImageInfo(
imgType = ImageType.Thumb; imgType = ImageType.Thumb;
imgTag = item.SeriesThumbImageTag; imgTag = item.SeriesThumbImageTag;
itemId = item.SeriesId; itemId = item.SeriesId;
} else if (shouldShowParentThumbImageTag(item.ParentThumbItemId, cardOptions)) {
imgType = ImageType.Thumb;
imgTag = item.ParentThumbImageTag;
itemId = item.ParentThumbItemId;
} else if ( } else if (
item.ParentBackdropImageTags?.length item.ParentBackdropImageTags?.length
&& cardOptions.inheritThumb !== false && cardOptions.inheritThumb !== false

View file

@ -758,8 +758,8 @@ const fetchGetSectionItems = async (
imageTypeLimit: 1, imageTypeLimit: 1,
enableImageTypes: [ enableImageTypes: [
ImageType.Primary, ImageType.Primary,
ImageType.Backdrop, ImageType.Thumb,
ImageType.Thumb ImageType.Backdrop
], ],
enableTotalRecordCount: false, enableTotalRecordCount: false,
...section.parametersOptions ...section.parametersOptions
@ -782,7 +782,11 @@ const fetchGetSectionItems = async (
ItemFields.MediaSourceCount ItemFields.MediaSourceCount
], ],
imageTypeLimit: 1, imageTypeLimit: 1,
enableImageTypes: [ImageType.Thumb], enableImageTypes: [
ImageType.Primary,
ImageType.Thumb,
ImageType.Backdrop
],
enableTotalRecordCount: false, enableTotalRecordCount: false,
...section.parametersOptions ...section.parametersOptions
}, },