Fix listen-mode audio quality labels in helpers.cr

This commit is contained in:
nhatnhoe-design 2026-05-20 16:50:35 +07:00
parent e82ac674ae
commit dd2facf1db

View File

@ -203,4 +203,9 @@ module Helpers
return tracker.as(Hash(String, Int64 | Float64))
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