Fix M18: make audio quality labels format-agnostic ("Best", not "Best (MP3)")

The audio quality preset "Best (MP3)" named a format that's wrong whenever the
audio format is opus/flac/wav. Renamed it to "Best" so the label never
contradicts the chosen audioFormat (which is picked separately). Bitrate presets
stay as bitrates and are already ignored for lossless formats (M21).

- AUDIO_QUALITY_OPTIONS[0]: 'Best (MP3)' -> 'Best' (buildArgs already had a
  `case 'Best'` returning '0', so arg generation is unchanged).
- Updated the main + renderer defaults and the preview/mock/test fixtures.
- Added a one-line migration in getSettings() that rewrites a stored legacy
  'Best (MP3)' to 'Best' so existing users' dropdowns match.

typecheck + 242 tests + eslint green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 15:46:55 -04:00
parent af6c4d3c67
commit 8cbfc90f5d
9 changed files with 21 additions and 15 deletions
+2 -4
View File
@@ -28,7 +28,7 @@ function opts(overrides: Partial<StartDownloadOptions> = {}): StartDownloadOptio
return { id: 't', url: URL, kind: 'video', quality: '1080p', ...overrides }
}
function audio(overrides: Partial<StartDownloadOptions> = {}): StartDownloadOptions {
return opts({ kind: 'audio', quality: 'Best (MP3)', ...overrides })
return opts({ kind: 'audio', quality: 'Best', ...overrides })
}
function dlo(overrides: Partial<DownloadOptions> = {}): DownloadOptions {
return { ...DEFAULT_DOWNLOAD_OPTIONS, ...overrides }
@@ -165,9 +165,7 @@ describe('audio: -x --audio-format <fmt>', () => {
})
it('maps the quality label to an --audio-quality value', () => {
expect(hasSeq(build(audio({ quality: 'Best (MP3)' }), dlo()), '--audio-quality', '0')).toBe(
true
)
expect(hasSeq(build(audio({ quality: 'Best' }), dlo()), '--audio-quality', '0')).toBe(true)
expect(hasSeq(build(audio({ quality: '320 kbps' }), dlo()), '--audio-quality', '320K')).toBe(
true
)
+2 -2
View File
@@ -146,7 +146,7 @@ describe.skipIf(!RUN)('real yt-dlp downloads (buildArgs end-to-end)', () => {
id: 'crop',
url: 'https://www.youtube.com/watch?v=jNQXAC9IVRw', // "Me at the zoo", 19s
kind: 'audio',
quality: 'Best (MP3)'
quality: 'Best'
}
const options = {
...DEFAULT_DOWNLOAD_OPTIONS,
@@ -181,7 +181,7 @@ describe.skipIf(!RUN)('real yt-dlp downloads (buildArgs end-to-end)', () => {
id: 'sb',
url,
kind: 'audio',
quality: 'Best (MP3)'
quality: 'Best'
}
const options = {
...DEFAULT_DOWNLOAD_OPTIONS,