Route downloads into Documents\Video / Documents\Audio and simplify the home page
- Create Documents\Video and Documents\Audio on startup (ensureMediaDirs), and route each download into them by kind when no explicit output folder is set. An empty outputDir now means "sort by type"; a chosen folder still overrides for both kinds. - Settings/Onboarding "Download folder" gains a placeholder + hint describing the blank = route-by-type behaviour. - Trim the home download bar to the essentials: URL box, Search and Paste buttons, format/quality, and the Download button. Removed the private-mode toggle, per-download Options panel, custom-command panel, command preview, and the saving-to-folder line. - Bump version to 0.3.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { spawn, execFile, type ChildProcess } from 'child_process'
|
||||
import { existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { app, BrowserWindow, Notification, type WebContents } from 'electron'
|
||||
import { BrowserWindow, Notification, type WebContents } from 'electron'
|
||||
import { getYtdlpPath, getBinDir, getAria2cPath, getFfmpegPath, getFfprobePath } from './binaries'
|
||||
import { getSettings, getDownloadArchivePath } from './settings'
|
||||
import { getSettings, getDownloadArchivePath, getDefaultMediaDir } from './settings'
|
||||
import { getCookiesFilePath } from './cookies'
|
||||
import { listTemplates } from './templates'
|
||||
import { assertHttpUrl } from './url'
|
||||
@@ -165,7 +165,11 @@ function resolveExtraArgs(opts: StartDownloadOptions, settings: Settings): strin
|
||||
/** Resolve settings + per-download overrides into the full yt-dlp argv. */
|
||||
export function buildCommand(opts: StartDownloadOptions): string[] {
|
||||
const settings = getSettings()
|
||||
const outDir = opts.outputDir?.trim() || settings.outputDir || app.getPath('downloads')
|
||||
// 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)
|
||||
// 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