Implemented remote side

This commit is contained in:
patben8 committed 2026-10-19 21:39:47 +02:00
1 parent 4cb630d0d5
commit 13ba2c721a
14 files changed
+880 -13

No files matched your search

+1 -5
View File
@@ -1026,11 +1026,7 @@ export default function App() {
/** Why Normalize cannot change these tracks' files, if so. */
const normalizeRefusal = (ids: string[]): string | null =>
analyzeRefusal(analyzeOrigin(ids)) ??
(editState.data?.remote
? 'Normalize is not available on a remote library yet'
: capabilities.data?.tracks.normalizable
? null
: "This library's audio files cannot be normalized")
(capabilities.data?.tracks.normalizable ? null : "This library's audio files cannot be normalized")
const analyzeOrigin = (ids: string[]): TrackOrigin =>
viewingDevice ? 'device' : viewingFolder && ids.some((id) => !folderFiles[id]) ? 'folder' : 'collection'
/** Why BPM / Grid / Key cannot be analysed for these tracks at all, if so. */
+4
View File
@@ -685,6 +685,8 @@ export interface NormalizeRow {
outcome?: 'apply' | 'capped' | 'at_target' | 'hot_peak_left' | 'unsupported' | 'unmeasured'
short_by?: number
lossless?: boolean
/** A remote library: a verified upload at this gain is already on the server. */
staged?: boolean
}
export interface NormalizePreview {
@@ -696,6 +698,8 @@ export interface NormalizePreview {
lossless: number
counts: Record<string, number>
rows: NormalizeRow[]
/** A remote library: what this computer downloads, rewrites and uploads. */
transfer?: { download: number; upload: number; speed: number; measured: boolean }
}
/** What a Normalize run did. */
@@ -79,6 +79,16 @@ export function NormalizeDialog({ ids, onRun, onClose, onError }: Props) {
if (c.hot_peak_left) lines.push(`${plural(c.hot_peak_left, 'hot peak')} left alone`)
if (c.unsupported) lines.push(`${plural(c.unsupported, 'file')} in a format that cannot be changed losslessly`)
if (c.skipped) lines.push(`${c.skipped} skipped`)
const t = p.transfer
if (t && (t.download || t.upload)) {
const mb = (b: number) => (b >= 1e9 ? `${(b / 1e9).toFixed(1)} GB` : `${Math.max(1, Math.round(b / 1e6))} MB`)
const secs = (t.download + t.upload) / Math.max(t.speed, 1)
lines.push(
`On the server: ${t.download ? `${mb(t.download)} downloaded, ` : ''}${mb(t.upload)} uploaded` +
` — about ${secs < 90 ? `${Math.max(1, Math.round(secs))} s` : `${Math.round(secs / 60)} min`}` +
(t.measured ? '' : ' (estimated)'),
)
}
return lines
}, [p])