feat: enhance locations and download categorization

- Fix system proxy fetching logic in download queue
- Expand recognized file formats across Windows, Mac, and Linux
- Automatically assign matching category folder for new downloads
- Add backend command to instantly create category directories on bulk base path selection
This commit is contained in:
NimBold
2026-06-15 18:21:44 +03:30
parent d15e537916
commit 12761caf10
7 changed files with 82 additions and 24 deletions
+11 -4
View File
@@ -8,8 +8,15 @@ import { useSettingsStore } from './useSettingsStore';
export type { DownloadCategory } from '../utils/downloads';
const getProxyArgs = (settings: ReturnType<typeof useSettingsStore.getState>) => {
if (settings.proxyMode === 'system') return 'system';
const getProxyArgs = async (settings: ReturnType<typeof useSettingsStore.getState>) => {
if (settings.proxyMode === 'system') {
try {
return await invoke('get_system_proxy');
} catch (e) {
console.warn("Failed to get system proxy:", e);
return null;
}
}
if (settings.proxyMode === 'custom' && settings.proxyHost) {
return `http://${settings.proxyHost}:${settings.proxyPort}`;
}
@@ -420,7 +427,7 @@ export const useDownloadStore = create<DownloadState>((set, get) => ({
username: item.username || (login ? login.username : null),
password: item.password || keychainPassword,
headers: item.headers || null,
proxy: getProxyArgs(settings),
proxy: await getProxyArgs(settings),
userAgent: settings.customUserAgent || null,
maxTries: settings.maxAutomaticRetries
});
@@ -440,7 +447,7 @@ export const useDownloadStore = create<DownloadState>((set, get) => ({
mirrors: item.mirrors || null,
userAgent: settings.customUserAgent || null,
maxTries: settings.maxAutomaticRetries,
proxy: getProxyArgs(settings)
proxy: await getProxyArgs(settings)
});
}
} catch (e) {