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:
+6
-3
@@ -128,7 +128,10 @@ export const VIDEO_QUALITY_OPTIONS = ['Best available', '1080p', '720p', '480p',
|
||||
export type VideoQuality = (typeof VIDEO_QUALITY_OPTIONS)[number]
|
||||
|
||||
/** Quality/format labels for the audio download selector. */
|
||||
export const AUDIO_QUALITY_OPTIONS = ['Best (MP3)', '320 kbps', '192 kbps', '128 kbps'] as const
|
||||
// Format-agnostic: the audio container/codec is chosen separately (downloadOptions
|
||||
// .audioFormat); these are just the target quality. Bitrate values are ignored for
|
||||
// lossless formats (flac/wav) -- see buildArgs (M18/M21).
|
||||
export const AUDIO_QUALITY_OPTIONS = ['Best', '320 kbps', '192 kbps', '128 kbps'] as const
|
||||
export type AudioQuality = (typeof AUDIO_QUALITY_OPTIONS)[number]
|
||||
|
||||
/** UI color theme: an explicit mode, or 'system' to follow the OS preference. */
|
||||
@@ -409,7 +412,7 @@ export interface StartDownloadOptions {
|
||||
id: string
|
||||
url: string
|
||||
kind: MediaKind
|
||||
/** one of the UI quality labels (e.g. '1080p', 'Best (MP3)') */
|
||||
/** one of the UI quality labels (e.g. '1080p', 'Best') */
|
||||
quality: string
|
||||
/** absolute output directory; main falls back to the OS Downloads folder */
|
||||
outputDir?: string
|
||||
@@ -614,7 +617,7 @@ export interface HistoryEntry {
|
||||
channel?: string
|
||||
url: string
|
||||
kind: MediaKind
|
||||
/** Quality preset ('720p', 'Best available', 'Best (MP3)', …) or the probed
|
||||
/** Quality preset ('720p', 'Best available', 'Best', …) or the probed
|
||||
* format's display label. Used for display and, when no formatId is present,
|
||||
* as the fallback quality selector on re-download (H5). */
|
||||
quality: string
|
||||
|
||||
Reference in New Issue
Block a user