diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-07 11:58:08 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-07 11:58:08 +0100 |
| commit | a8a8e97a2b8187a49993c774471155346508de47 (patch) | |
| tree | b5380d06be40d80f6e3afa525173a2a8dd84ed87 | |
| parent | b074d4927f699dc662a56c701d31787b711e331a (diff) | |
| download | quickshell-a8a8e97a2b8187a49993c774471155346508de47.tar.gz quickshell-a8a8e97a2b8187a49993c774471155346508de47.zip | |
sonix: SonixLink's bitrate is in bits per second
| -rw-r--r-- | desktop/modules/sonix/Sonix.js | 2 | ||||
| -rw-r--r-- | desktop/modules/sonix/test_sonix.js | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/desktop/modules/sonix/Sonix.js b/desktop/modules/sonix/Sonix.js index 76ac1f5..d4330ce 100644 --- a/desktop/modules/sonix/Sonix.js +++ b/desktop/modules/sonix/Sonix.js @@ -35,7 +35,7 @@ function qualityLine(s) { if (m) parts.push(m[1].toUpperCase()); if (s.sample_rate > 0) parts.push(s.bits > 0 ? `${s.bits}/${rateText(s.sample_rate)}` : `${rateText(s.sample_rate)} kHz`); - if (s.bitrate > 0) parts.push(`${s.bitrate} kbps`); + if (s.bitrate > 0) parts.push(`${Math.round(s.bitrate / 1000)} kbps`); return parts.join(" · "); } diff --git a/desktop/modules/sonix/test_sonix.js b/desktop/modules/sonix/test_sonix.js index c19a123..32da061 100644 --- a/desktop/modules/sonix/test_sonix.js +++ b/desktop/modules/sonix/test_sonix.js @@ -31,9 +31,9 @@ assert.strictEqual(S.parseBeacon("SONIXLINK1 10.0.0.5 0 x"), null); assert.strictEqual(S.parseBeacon("SONIXLINK1 10.0.0.5 7800"), null); // Quality line from /api/state fields. -assert.strictEqual(S.qualityLine({ path: "/mnt/sd_0/a/b.flac", sample_rate: 96000, bits: 24, bitrate: 2304 }), +assert.strictEqual(S.qualityLine({ path: "/mnt/sd_0/a/b.flac", sample_rate: 96000, bits: 24, bitrate: 2304000 }), "FLAC · 24/96 · 2304 kbps"); -assert.strictEqual(S.qualityLine({ path: "x.mp3", sample_rate: 44100, bits: 0, bitrate: 320 }), +assert.strictEqual(S.qualityLine({ path: "x.mp3", sample_rate: 44100, bits: 0, bitrate: 320000 }), "MP3 · 44.1 kHz · 320 kbps"); assert.strictEqual(S.qualityLine({ path: "", sample_rate: 0, bits: 0, bitrate: 0 }), ""); |
