From 7901fc7e82a3bb985d0b0e68f9a71293a91c7df6 Mon Sep 17 00:00:00 2001 From: Nexmoe <16796652+nexmoe@users.noreply.github.com> Date: Sat, 8 Nov 2025 13:40:17 +0800 Subject: [PATCH] feat(settings): remove 'auto' preset and default to 'best' to (#16) --- src/main/download-engine/format-utils.ts | 4 +--- src/renderer/src/components/video/FormatSelector.tsx | 1 - src/renderer/src/pages/Home.tsx | 4 +--- src/renderer/src/pages/Settings.tsx | 3 --- src/shared/types/index.ts | 4 ++-- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/main/download-engine/format-utils.ts b/src/main/download-engine/format-utils.ts index 6cd083e..c9e9b6e 100644 --- a/src/main/download-engine/format-utils.ts +++ b/src/main/download-engine/format-utils.ts @@ -6,7 +6,6 @@ import type { } from '../../shared/types' const qualityPresetToVideoHeight: Record = { - auto: null, best: null, good: 1080, normal: 720, @@ -15,7 +14,6 @@ const qualityPresetToVideoHeight: Record = } const qualityPresetToAudioAbr: Record = { - auto: null, best: 320, good: 256, normal: 192, @@ -187,7 +185,7 @@ export const resolveSelectedFormat = ( return directMatch } - const preset = settings.oneClickQuality ?? 'auto' + const preset = settings.oneClickQuality ?? 'best' if (options.type === 'video') { const videoFormats = formats.filter( diff --git a/src/renderer/src/components/video/FormatSelector.tsx b/src/renderer/src/components/video/FormatSelector.tsx index c9c4631..5cf2769 100644 --- a/src/renderer/src/components/video/FormatSelector.tsx +++ b/src/renderer/src/components/video/FormatSelector.tsx @@ -12,7 +12,6 @@ import { useTranslation } from 'react-i18next' import type { OneClickQualityPreset, VideoFormat } from '../../../../shared/types' const qualityPresetToVideoHeight: Record = { - auto: null, best: null, good: 1080, normal: 720, diff --git a/src/renderer/src/pages/Home.tsx b/src/renderer/src/pages/Home.tsx index 4b21c76..7c3bc96 100644 --- a/src/renderer/src/pages/Home.tsx +++ b/src/renderer/src/pages/Home.tsx @@ -42,7 +42,6 @@ import { } from '../store/video' const qualityPresetToVideoHeight: Record = { - auto: null, best: null, good: 1080, normal: 720, @@ -51,7 +50,6 @@ const qualityPresetToVideoHeight: Record = } const qualityPresetToAudioAbr: Record = { - auto: null, best: 320, good: 256, normal: 192, @@ -72,7 +70,7 @@ const dedupe = (candidates: Array): string[] => { } const getQualityPreset = (settings: AppSettings): OneClickQualityPreset => - settings.oneClickQuality ?? 'auto' + settings.oneClickQuality ?? 'best' const buildAudioSelectors = (preset: OneClickQualityPreset): string[] => { if (preset === 'worst') { diff --git a/src/renderer/src/pages/Settings.tsx b/src/renderer/src/pages/Settings.tsx index 5502ed7..1153f4b 100644 --- a/src/renderer/src/pages/Settings.tsx +++ b/src/renderer/src/pages/Settings.tsx @@ -235,9 +235,6 @@ export function Settings() { - - {t('settings.oneClickQualityOptions.auto')} - {t('settings.oneClickQualityOptions.best')} diff --git a/src/shared/types/index.ts b/src/shared/types/index.ts index 7910611..92b2ad2 100644 --- a/src/shared/types/index.ts +++ b/src/shared/types/index.ts @@ -172,7 +172,7 @@ export interface PlaylistDownloadResult { } // Settings types -export type OneClickQualityPreset = 'auto' | 'best' | 'good' | 'normal' | 'bad' | 'worst' +export type OneClickQualityPreset = 'best' | 'good' | 'normal' | 'bad' | 'worst' export interface AppSettings { downloadPath: string @@ -206,7 +206,7 @@ export const defaultSettings: AppSettings = { theme: 'system', oneClickDownload: false, oneClickDownloadType: 'video', - oneClickQuality: 'auto', + oneClickQuality: 'best', closeToTray: false, hideDockIcon: false, autoUpdate: true