Separate per-kind video/audio folders, defaulting to Documents\Video and Documents\Audio
Existing installs had outputDir persisted to the Downloads folder (auto-filled by earlier versions), so the v0.3.0 per-kind routing never triggered — downloads kept going to Downloads. Replace the single outputDir setting with independent videoDir and audioDir settings: - Settings model: drop Settings.outputDir; add videoDir + audioDir (both blank by default). A blank value routes that kind into Documents\Video / Documents\Audio; a chosen folder overrides it. The stale outputDir key in old settings files is simply ignored, so existing users now get the Documents defaults. - buildCommand routes by kind: per-download override → per-kind folder → default. - The renderer no longer sends a global outputDir, so main always routes by kind. - Settings: the single "Download folder" field becomes separate "Video folder" and "Audio folder" pickers, each with a Browse + Reset and a Documents\… placeholder. Store gains chooseDir(target) / clearDir(target). - Onboarding: replace the folder picker with a short note about the two default folders (changeable in Settings). - Bump version to 0.3.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -166,10 +166,10 @@ function resolveExtraArgs(opts: StartDownloadOptions, settings: Settings): strin
|
||||
export function buildCommand(opts: StartDownloadOptions): string[] {
|
||||
const settings = getSettings()
|
||||
// Output dir resolution: a per-download override wins, then the user's explicit
|
||||
// global folder (Settings → Download folder), and finally — when both are blank —
|
||||
// the per-kind default (Documents\Video for video, Documents\Audio for audio).
|
||||
const outDir =
|
||||
opts.outputDir?.trim() || settings.outputDir?.trim() || getDefaultMediaDir(opts.kind)
|
||||
// per-kind folder (Settings → Video/Audio folder), and finally — when that's
|
||||
// blank — the per-kind default (Documents\Video for video, Documents\Audio for audio).
|
||||
const perKindDir = (opts.kind === 'audio' ? settings.audioDir : settings.videoDir)?.trim()
|
||||
const outDir = opts.outputDir?.trim() || perKindDir || getDefaultMediaDir(opts.kind)
|
||||
// A collection (media-manager) download is filed into <channel>/<playlist>/
|
||||
// <NNN> - <title> folders; an ordinary download uses the flat filenameTemplate.
|
||||
const filenameTemplate = settings.filenameTemplate?.trim() || '%(title)s.%(ext)s'
|
||||
|
||||
Reference in New Issue
Block a user