refactor: track lengths and file sizes come from the shared formatters on Missing files, Duplicates, a want's Releases and the app download; an hour-long track reads 1:01:05, not 61:05 (M505 #5639 #5640)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 16:14:01 -04:00
co-authored by Claude Opus 5.5
parent 9e7d50b38e
commit 622f248ea2
7 changed files with 35 additions and 32 deletions
@@ -2,6 +2,7 @@
import { onMount } from 'svelte';
import { Download, Smartphone } from 'lucide-svelte';
import { api } from '#lib/api/client.js';
import { formatBytes } from '#lib/utils/bytes.js';
import SettingsGroup from '#lib/components/settings/SettingsGroup.svelte';
import SettingRow from '#lib/components/settings/SettingRow.svelte';
@@ -20,11 +21,6 @@
let info = $state<Info | null>(null);
function formatSize(bytes: number): string {
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`;
return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
}
onMount(async () => {
try {
const body = await api.get<Partial<WireInfo>>('/api/client/version');
@@ -44,7 +40,7 @@
<SettingsGroup title="Android app">
<SettingRow
label="Minstrel for Android"
hint="{info.version}{info.sizeBytes > 0 ? ` · ${formatSize(info.sizeBytes)}` : ''} · sign in with this account"
hint="{info.version}{info.sizeBytes > 0 ? ` · ${formatBytes(info.sizeBytes)}` : ''} · sign in with this account"
>
<Smartphone size={18} strokeWidth={1.5} class="text-text-secondary" aria-hidden="true" />
<a