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 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 15:55:19 -04:00
parent 15d64b7ba6
commit 0f572488fc
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -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
}