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

Merge pull request #5587 from scampower3/fix-square-posters

This commit is contained in:
Bill Thornton 2024-05-23 13:18:46 -04:00 committed by GitHub
commit 9e34ae8b42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 9 deletions

View file

@ -89,7 +89,7 @@ export function setCardData(items, options) {
options.coverImage = true; options.coverImage = true;
} else if (primaryImageAspectRatio >= 1.33) { } else if (primaryImageAspectRatio >= 1.33) {
options.shape = getBackdropShape(requestedShape === 'autooverflow'); options.shape = getBackdropShape(requestedShape === 'autooverflow');
} else if (primaryImageAspectRatio > 0.71) { } else if (primaryImageAspectRatio > 0.8) {
options.shape = getSquareShape(requestedShape === 'autooverflow'); options.shape = getSquareShape(requestedShape === 'autooverflow');
} else { } else {
options.shape = getPortraitShape(requestedShape === 'autooverflow'); options.shape = getPortraitShape(requestedShape === 'autooverflow');

View file

@ -454,15 +454,15 @@ describe('resolveMixedShapeByAspectRatio', () => {
expect(resolveMixedShapeByAspectRatio(1.34)).toEqual('mixedBackdrop'); expect(resolveMixedShapeByAspectRatio(1.34)).toEqual('mixedBackdrop');
}); });
test('primary aspect ratio is > 0.71', () => { test('primary aspect ratio is > 0.8', () => {
expect(resolveMixedShapeByAspectRatio(0.72)).toEqual('mixedSquare'); expect(resolveMixedShapeByAspectRatio(0.81)).toEqual('mixedSquare');
expect(resolveMixedShapeByAspectRatio(0.73)).toEqual('mixedSquare'); expect(resolveMixedShapeByAspectRatio(0.82)).toEqual('mixedSquare');
expect(resolveMixedShapeByAspectRatio(1.32)).toEqual('mixedSquare'); expect(resolveMixedShapeByAspectRatio(1.32)).toEqual('mixedSquare');
}); });
test('primary aspect ratio is <= 0.71', () => { test('primary aspect ratio is <= 0.8', () => {
expect(resolveMixedShapeByAspectRatio(0.71)).toEqual('mixedPortrait'); expect(resolveMixedShapeByAspectRatio(0.8)).toEqual('mixedPortrait');
expect(resolveMixedShapeByAspectRatio(0.70)).toEqual('mixedPortrait'); expect(resolveMixedShapeByAspectRatio(0.79)).toEqual('mixedPortrait');
expect(resolveMixedShapeByAspectRatio(0.01)).toEqual('mixedPortrait'); expect(resolveMixedShapeByAspectRatio(0.01)).toEqual('mixedPortrait');
}); });

View file

@ -60,7 +60,7 @@ export const resolveMixedShapeByAspectRatio = (primaryImageAspectRatio: number |
if (primaryImageAspectRatio >= 1.33) { if (primaryImageAspectRatio >= 1.33) {
return CardShape.MixedBackdrop; return CardShape.MixedBackdrop;
} else if (primaryImageAspectRatio > 0.71) { } else if (primaryImageAspectRatio > 0.8) {
return CardShape.MixedSquare; return CardShape.MixedSquare;
} else { } else {
return CardShape.MixedPortrait; return CardShape.MixedPortrait;

View file

@ -21,7 +21,7 @@ export function buildCardImage(
shape = CardShape.Banner; shape = CardShape.Banner;
} else if (item.PrimaryImageAspectRatio >= 1.33) { } else if (item.PrimaryImageAspectRatio >= 1.33) {
shape = CardShape.Backdrop; shape = CardShape.Backdrop;
} else if (item.PrimaryImageAspectRatio > 0.71) { } else if (item.PrimaryImageAspectRatio > 0.8) {
shape = CardShape.Square; shape = CardShape.Square;
} else { } else {
shape = CardShape.Portrait; shape = CardShape.Portrait;