fix(downloads): handle root category folders and cookie fallback

Allow explicit empty category subfolders to resolve to the base download folder across settings, UI, and backend ownership paths.

Retry yt-dlp metadata and media downloads without browser cookies when the selected browser cookie database cannot be copied, while preserving real auth failures.

Fixes #6

Fixes #7
This commit is contained in:
NimBold
2026-07-06 20:19:33 +03:30
parent 5ea46024e9
commit 99f73eaae2
6 changed files with 147 additions and 35 deletions
+6 -2
View File
@@ -175,7 +175,9 @@ const CategoryFolderInput = ({
onBrowse: () => void;
}) => {
const base = settings.baseDownloadFolder || '~/Downloads';
const sub = settings.categorySubfolders[category] || DEFAULT_CATEGORY_SUBFOLDERS[category as keyof typeof DEFAULT_CATEGORY_SUBFOLDERS];
const sub = Object.prototype.hasOwnProperty.call(settings.categorySubfolders, category)
? settings.categorySubfolders[category]
: DEFAULT_CATEGORY_SUBFOLDERS[category as keyof typeof DEFAULT_CATEGORY_SUBFOLDERS];
const override = settings.categoryDirectoryOverrides[category];
const displayPath = override ?? formatDerivedCategoryPath(base, sub);
@@ -480,7 +482,9 @@ runEngineChecks(false);
DOWNLOAD_CATEGORIES.map(category => [
category,
normalizeCategorySubfolder(
settings.categorySubfolders[category] || '',
Object.prototype.hasOwnProperty.call(settings.categorySubfolders, category)
? settings.categorySubfolders[category]
: DEFAULT_CATEGORY_SUBFOLDERS[category],
DEFAULT_CATEGORY_SUBFOLDERS[category]
)
])