diff options
Diffstat (limited to 'desktop/modules/sonix')
| -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 }), ""); |
