mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
Add resolution text output for more resolutions
This commit is contained in:
parent
84a1674f39
commit
f8ea4577ab
2 changed files with 29 additions and 13 deletions
|
@ -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,25 +109,32 @@ 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(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, 544, false, "540p")]
|
||||
[InlineData(960, 544, true, "540i")]
|
||||
[InlineData(720, 576, false, "576p")]
|
||||
[InlineData(720, 576, true, "576i")]
|
||||
[InlineData(960, 540, false, "540p")]
|
||||
[InlineData(960, 540, true, "540i")]
|
||||
[InlineData(1280, 720, false, "720p")]
|
||||
[InlineData(1280, 720, true, "720i")]
|
||||
[InlineData(1920, 1080, false, "1080p")]
|
||||
[InlineData(1920, 1080, true, "1080i")]
|
||||
[InlineData(4096, 3072, false, "4K")]
|
||||
[InlineData(8192, 6144, false, "8K")]
|
||||
[InlineData(576, 336, false, "360p")]
|
||||
[InlineData(624, 352, false, "360p")]
|
||||
[InlineData(640, 352, false, "360p")]
|
||||
[InlineData(512, 384, false, "480p")]
|
||||
[InlineData(576, 336, false, "480p")]
|
||||
[InlineData(624, 352, false, "480p")]
|
||||
[InlineData(640, 352, false, "480p")]
|
||||
[InlineData(704, 396, false, "480p")]
|
||||
[InlineData(720, 404, false, "480p")]
|
||||
[InlineData(720, 480, false, "480p")]
|
||||
[InlineData(640, 480, false, "480p")]
|
||||
[InlineData(768, 576, false, "576p")]
|
||||
[InlineData(960, 720, false, "720p")]
|
||||
[InlineData(1280, 528, false, "720p")]
|
||||
|
@ -156,6 +163,8 @@ namespace Jellyfin.Model.Tests.Entities
|
|||
[InlineData(1920, 1072, false, "1080p")]
|
||||
[InlineData(1440, 1072, false, "1080p")]
|
||||
[InlineData(1440, 1080, false, "1080p")]
|
||||
[InlineData(1440, 1440, false, "1080p")]
|
||||
[InlineData(1920, 1440, false, "1080p")]
|
||||
[InlineData(3840, 1600, false, "4K")]
|
||||
[InlineData(3840, 1606, false, "4K")]
|
||||
[InlineData(3840, 1608, false, "4K")]
|
||||
|
|
Loading…
Reference in a new issue