diff options
author | metamuffin <metamuffin@disroot.org> | 2023-12-19 16:49:50 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-12-19 16:49:50 +0100 |
commit | ddb719feebdf0bfd49fd109ca82ad8c592f63ac5 (patch) | |
tree | 2267f9257cf6aede11020bab3928b874c76e400f /server/src/routes/ui | |
parent | 1c920548bae5f70f31d28c6c0cc753712bb713c3 (diff) | |
download | jellything-ddb719feebdf0bfd49fd109ca82ad8c592f63ac5.tar jellything-ddb719feebdf0bfd49fd109ca82ad8c592f63ac5.tar.bz2 jellything-ddb719feebdf0bfd49fd109ca82ad8c592f63ac5.tar.zst |
better resolution detection
Diffstat (limited to 'server/src/routes/ui')
-rw-r--r-- | server/src/routes/ui/node.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/src/routes/ui/node.rs b/server/src/routes/ui/node.rs index fbbf012..e7e1c70 100644 --- a/server/src/routes/ui/node.rs +++ b/server/src/routes/ui/node.rs @@ -257,15 +257,17 @@ trait MediaInfoExt { } impl MediaInfoExt for MediaInfo { fn resolution_name(&self) -> &'static str { - let mut maxw = 0; + let mut maxdim = 0; for t in &self.tracks { match &t.kind { - SourceTrackKind::Video { width, .. } => maxw = maxw.max(*width), + SourceTrackKind::Video { width, height, .. } => maxdim = maxdim.max(*width.max(height)), _ => (), } } - match maxw { + match maxdim { + 30720.. => "32K", + 15360.. => "16K", 7680.. => "8K", 3840.. => "4K", 2560.. => "WQHD", |