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

Merge pull request #5787 from grafixeyehero/Fix-ParentThumbImage

Fix parent thumb image for next up and continue watching in experimental layout
This commit is contained in:
Bill Thornton 2024-07-15 15:43:23 -04:00 committed by GitHub
commit ddb9f66609
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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

@ -759,8 +759,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
@ -783,7 +783,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
}, },