mirror of
https://github.com/iv-org/invidious.git
synced 2026-07-08 06:36:46 -05:00
Fix listen-mode audio quality labels in helpers.cr
This commit is contained in:
parent
e82ac674ae
commit
dd2facf1db
@ -203,4 +203,9 @@ module Helpers
|
|||||||
|
|
||||||
return tracker.as(Hash(String, Int64 | Float64))
|
return tracker.as(Hash(String, Int64 | Float64))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def format_audio_quality_label(bitrate : JSON::Any) : String
|
||||||
|
val = bitrate.as_i? || bitrate.as_s?.try(&.to_i?) || 0
|
||||||
|
"#{(val / 1000).round.to_i}k"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user