Backport pull request #8104 from jellyfin/release-10.8.z
Add resolution text output for more resolutions
Authored-by: Shadowghost <Ghost_of_Stone@web.de>
Merged-by: Bond-009 <bond.009@outlook.com>
Original-merge: 2b46917dcf
This commit is contained in:
parent
adc08b5b4c
commit
924b0740b1
|
@ -588,15 +588,22 @@ namespace MediaBrowser.Model.Entities
|
|||
|
||||
return Width switch
|
||||
{
|
||||
<= 720 when Height <= 480 => IsInterlaced ? "480i" : "480p",
|
||||
// 720x576 (PAL) (768 when rescaled for square pixels)
|
||||
<= 768 when Height <= 576 => IsInterlaced ? "576i" : "576p",
|
||||
// 960x540 (sometimes 544 which is multiple of 16)
|
||||
// 256x144 (16:9 square pixel format)
|
||||
<= 256 when Height <= 144 => IsInterlaced ? "144i" : "144p",
|
||||
// 426x240 (16:9 square pixel format)
|
||||
<= 426 when Height <= 240 => IsInterlaced ? "240i" : "240p",
|
||||
// 640x360 (16:9 square pixel format)
|
||||
<= 640 when Height <= 360 => IsInterlaced ? "360i" : "360p",
|
||||
// 854x480 (16:9 square pixel format)
|
||||
<= 854 when Height <= 480 => IsInterlaced ? "480i" : "480p",
|
||||
// 960x544 (16:9 square pixel format)
|
||||
<= 960 when Height <= 544 => IsInterlaced ? "540i" : "540p",
|
||||
// 1024x576 (16:9 square pixel format)
|
||||
<= 1024 when Height <= 576 => IsInterlaced ? "576i" : "576p",
|
||||
// 1280x720
|
||||
<= 1280 when Height <= 962 => IsInterlaced ? "720i" : "720p",
|
||||
// 1920x1080
|
||||
<= 1920 when Height <= 1440 => IsInterlaced ? "1080i" : "1080p",
|
||||
// 2560x1080 (FHD ultra wide 21:9) using 1440px width to accomodate WQHD
|
||||
<= 2560 when Height <= 1440 => IsInterlaced ? "1080i" : "1080p",
|
||||
// 4K
|
||||
<= 4096 when Height <= 3072 => "4K",
|
||||
// 8K
|
||||
|
|
|
@ -109,26 +109,37 @@ namespace Jellyfin.Model.Tests.Entities
|
|||
[InlineData(null, null, false, null)]
|
||||
[InlineData(null, 0, false, null)]
|
||||
[InlineData(0, null, false, null)]
|
||||
[InlineData(640, 480, false, "480p")]
|
||||
[InlineData(640, 480, true, "480i")]
|
||||
[InlineData(720, 576, false, "576p")]
|
||||
[InlineData(720, 576, true, "576i")]
|
||||
[InlineData(256, 144, false, "144p")]
|
||||
[InlineData(256, 144, true, "144i")]
|
||||
[InlineData(426, 240, false, "240p")]
|
||||
[InlineData(426, 240, true, "240i")]
|
||||
[InlineData(640, 360, false, "360p")]
|
||||
[InlineData(640, 360, true, "360i")]
|
||||
[InlineData(854, 480, false, "480p")]
|
||||
[InlineData(854, 480, true, "480i")]
|
||||
[InlineData(960, 540, false, "540p")]
|
||||
[InlineData(960, 540, true, "540i")]
|
||||
[InlineData(1024, 576, false, "576p")]
|
||||
[InlineData(1024, 576, true, "576i")]
|
||||
[InlineData(1280, 720, false, "720p")]
|
||||
[InlineData(1280, 720, true, "720i")]
|
||||
[InlineData(1920, 1080, false, "1080p")]
|
||||
[InlineData(1920, 1080, true, "1080i")]
|
||||
[InlineData(2560, 1080, false, "1080p")]
|
||||
[InlineData(2560, 1080, true, "1080i")]
|
||||
[InlineData(4096, 3072, false, "4K")]
|
||||
[InlineData(8192, 6144, false, "8K")]
|
||||
[InlineData(512, 384, false, "480p")]
|
||||
[InlineData(576, 336, false, "480p")]
|
||||
[InlineData(624, 352, false, "480p")]
|
||||
[InlineData(640, 352, false, "480p")]
|
||||
[InlineData(576, 336, false, "360p")]
|
||||
[InlineData(576, 336, true, "360i")]
|
||||
[InlineData(624, 352, false, "360p")]
|
||||
[InlineData(640, 352, false, "360p")]
|
||||
[InlineData(640, 480, false, "480p")]
|
||||
[InlineData(704, 396, false, "480p")]
|
||||
[InlineData(720, 404, false, "480p")]
|
||||
[InlineData(720, 480, false, "480p")]
|
||||
[InlineData(720, 576, false, "576p")]
|
||||
[InlineData(768, 576, false, "576p")]
|
||||
[InlineData(960, 544, false, "540p")]
|
||||
[InlineData(960, 544, true, "540i")]
|
||||
[InlineData(960, 720, false, "720p")]
|
||||
[InlineData(1280, 528, false, "720p")]
|
||||
[InlineData(1280, 532, false, "720p")]
|
||||
|
@ -140,6 +151,11 @@ namespace Jellyfin.Model.Tests.Entities
|
|||
[InlineData(1280, 696, false, "720p")]
|
||||
[InlineData(1280, 716, false, "720p")]
|
||||
[InlineData(1280, 718, false, "720p")]
|
||||
[InlineData(1920, 1080, false, "1080p")]
|
||||
[InlineData(1440, 1070, false, "1080p")]
|
||||
[InlineData(1440, 1072, false, "1080p")]
|
||||
[InlineData(1440, 1080, false, "1080p")]
|
||||
[InlineData(1440, 1440, false, "1080p")]
|
||||
[InlineData(1912, 792, false, "1080p")]
|
||||
[InlineData(1916, 1076, false, "1080p")]
|
||||
[InlineData(1918, 1080, false, "1080p")]
|
||||
|
@ -153,14 +169,16 @@ namespace Jellyfin.Model.Tests.Entities
|
|||
[InlineData(1920, 960, false, "1080p")]
|
||||
[InlineData(1920, 1024, false, "1080p")]
|
||||
[InlineData(1920, 1040, false, "1080p")]
|
||||
[InlineData(1920, 1070, false, "1080p")]
|
||||
[InlineData(1920, 1072, false, "1080p")]
|
||||
[InlineData(1440, 1072, false, "1080p")]
|
||||
[InlineData(1440, 1080, false, "1080p")]
|
||||
[InlineData(1920, 1440, false, "1080p")]
|
||||
[InlineData(3840, 1600, false, "4K")]
|
||||
[InlineData(3840, 1606, false, "4K")]
|
||||
[InlineData(3840, 1608, false, "4K")]
|
||||
[InlineData(3840, 2160, false, "4K")]
|
||||
[InlineData(4090, 3070, false, "4K")]
|
||||
[InlineData(7680, 4320, false, "8K")]
|
||||
[InlineData(8190, 6140, false, "8K")]
|
||||
public void GetResolutionText_Valid(int? width, int? height, bool interlaced, string expected)
|
||||
{
|
||||
var mediaStream = new MediaStream()
|
||||
|
|
Loading…
Reference in New Issue
Block a user