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:
commit
ddb9f66609
2 changed files with 15 additions and 11 deletions
|
@ -38,12 +38,12 @@ function getPreferThumbInfo(item: ItemDto, cardOptions: CardOptions) {
|
|||
} else if (
|
||||
item.ParentBackdropImageTags?.length
|
||||
&& cardOptions.inheritThumb !== false
|
||||
&& item.Type === BaseItemKind.Episode
|
||||
) {
|
||||
imgType = ImageType.Backdrop;
|
||||
imgTag = item.ParentBackdropImageTags[0];
|
||||
itemId = item.ParentBackdropItemId;
|
||||
}
|
||||
|
||||
return {
|
||||
itemId: itemId,
|
||||
imgTag: imgTag,
|
||||
|
@ -139,11 +139,11 @@ function shouldShowParentThumbImageTag(
|
|||
cardOptions: CardOptions
|
||||
): boolean {
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -185,6 +185,10 @@ function getCardImageInfo(
|
|||
imgType = preferLogoInfo.imgType;
|
||||
imgTag = preferLogoInfo.imgType;
|
||||
itemId = preferLogoInfo.itemId;
|
||||
} else if (shouldShowParentThumbImageTag(item.ParentThumbItemId, cardOptions)) {
|
||||
imgType = ImageType.Thumb;
|
||||
imgTag = item.ParentThumbImageTag;
|
||||
itemId = item.ParentThumbItemId;
|
||||
} else if (shouldShowImageTagsPrimary(item)) {
|
||||
imgType = ImageType.Primary;
|
||||
imgTag = item.ImageTags?.Primary;
|
||||
|
@ -207,7 +211,7 @@ function getCardImageInfo(
|
|||
imgType = ImageType.Primary;
|
||||
imgTag = item.ParentPrimaryImageTag;
|
||||
itemId = item.ParentPrimaryImageItemId;
|
||||
} else if (shouldShowParentBackdropImageTags(item)) {
|
||||
} else if (shouldShowAlbumPrimaryImageTag(item)) {
|
||||
imgType = ImageType.Primary;
|
||||
imgTag = item.AlbumPrimaryImageTag;
|
||||
itemId = item.AlbumId;
|
||||
|
@ -226,10 +230,6 @@ function getCardImageInfo(
|
|||
imgType = ImageType.Thumb;
|
||||
imgTag = item.SeriesThumbImageTag;
|
||||
itemId = item.SeriesId;
|
||||
} else if (shouldShowParentThumbImageTag(item.ParentThumbItemId, cardOptions)) {
|
||||
imgType = ImageType.Thumb;
|
||||
imgTag = item.ParentThumbImageTag;
|
||||
itemId = item.ParentThumbItemId;
|
||||
} else if (
|
||||
item.ParentBackdropImageTags?.length
|
||||
&& cardOptions.inheritThumb !== false
|
||||
|
|
|
@ -759,8 +759,8 @@ const fetchGetSectionItems = async (
|
|||
imageTypeLimit: 1,
|
||||
enableImageTypes: [
|
||||
ImageType.Primary,
|
||||
ImageType.Backdrop,
|
||||
ImageType.Thumb
|
||||
ImageType.Thumb,
|
||||
ImageType.Backdrop
|
||||
],
|
||||
enableTotalRecordCount: false,
|
||||
...section.parametersOptions
|
||||
|
@ -783,7 +783,11 @@ const fetchGetSectionItems = async (
|
|||
ItemFields.MediaSourceCount
|
||||
],
|
||||
imageTypeLimit: 1,
|
||||
enableImageTypes: [ImageType.Thumb],
|
||||
enableImageTypes: [
|
||||
ImageType.Primary,
|
||||
ImageType.Thumb,
|
||||
ImageType.Backdrop
|
||||
],
|
||||
enableTotalRecordCount: false,
|
||||
...section.parametersOptions
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue