From 0f572488fc8f8f3f4eb64ccbf7ef0c404f261a56 Mon Sep 17 00:00:00 2001 From: debont80 Date: Tue, 30 Jun 2026 15:55:19 -0400 Subject: [PATCH] Fix L62: drop hardcoded ext:'mp4' from the synthetic "Best available" format The auto-best format option claimed ext:'mp4', but the real output container for the best pick depends on the user's videoContainer setting (mp4/mkv/webm), so it mislabeled mkv/webm outputs. ext is optional on FormatOption and the option's label is the fixed "Best available", so the field is simply omitted. hasAudio:true is kept (the best pick always merges an audio track). typecheck + 242 tests + eslint green. Co-Authored-By: Claude Opus 4.8 --- CODE-AUDIT.md | 2 +- src/main/probe.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CODE-AUDIT.md b/CODE-AUDIT.md index bf2c262..adf1ce9 100644 --- a/CODE-AUDIT.md +++ b/CODE-AUDIT.md @@ -495,7 +495,7 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n hand-synced color constants (a "keep in sync" comment guards them). - [x] **L60 — `'external-url'` channel name lacks the `category:` prefix** every other IPC channel uses. - [x] **L61 — `taskbarProgress` is the lone `ipcMain.on`** (fire-and-forget) amid all-`invoke` channels. -- [ ] **L62 — "Best available" synthetic format hardcodes `ext:'mp4'`/`hasAudio:true`** (probe.ts) — +- [x] **L62 — "Best available" synthetic format hardcodes `ext:'mp4'`/`hasAudio:true`** (probe.ts) — mislabels when the chosen container is mkv/webm. - [x] **L63 — `audioQuality()` unknown label → silent `'0'` (best)** — the audio analog of H5. - [ ] **L64 — `ARIA2C_ARGS` connection params hardcoded** (`-x16 -s16 -k1M`), no user control. diff --git a/src/main/probe.ts b/src/main/probe.ts index 3bef06e..266ceb3 100644 --- a/src/main/probe.ts +++ b/src/main/probe.ts @@ -69,7 +69,10 @@ function buildVideoFormats(raw: RawFormat[]): FormatOption[] { const options = [...bestByHeight.values()] .sort((a, b) => (b.height ?? 0) - (a.height ?? 0)) .map(toOption) - options.unshift({ id: BEST_FORMAT_ID, label: 'Best available', ext: 'mp4', hasAudio: true }) + // No `ext`: the final container for the auto-best pick depends on the user's + // videoContainer setting (mp4/mkv/webm), unknown here -- claiming 'mp4' would + // mislabel mkv/webm outputs (L62). hasAudio is always true (best merges audio). + options.unshift({ id: BEST_FORMAT_ID, label: 'Best available', hasAudio: true }) return options }