1000+ kbps

When bitrate exceeds 1000 kbps, Winamp shows "10H", and will increment "11H" etc. as needed. Usually happens with FLAC files.

For bitrates less than 100, there is leading space.
This commit is contained in:
Andrew 2021-04-27 23:34:17 -04:00
parent 880787f569
commit dd193802be

View file

@ -5,7 +5,10 @@ import * as Selectors from "../../selectors";
import { useTypedSelector } from "../../hooks";
const Kbps = memo(() => {
const kbps = useTypedSelector(Selectors.getKbps);
let kbps = useTypedSelector(Selectors.getKbps)?.padStart(3);
if (kbps !== undefined && kbps?.length > 3) {
kbps = kbps.substring(0, 2) + "H";
}
return (
<div id="kbps">
<CharacterString>{kbps || ""}</CharacterString>