feat: implement tweakable utility workers concurrency, instead of hard-coded value set to 5

This commit is contained in:
Xoconoch
2025-08-29 08:33:23 -06:00
parent fe5e7964fa
commit 41db454414
5 changed files with 91 additions and 7 deletions

View File

@@ -32,6 +32,7 @@ export type FlatAppSettings = {
deezer: string;
deezerQuality: "MP3_128" | "MP3_320" | "FLAC";
maxConcurrentDownloads: number;
utilityConcurrency: number;
realTime: boolean;
fallback: boolean;
convertTo: "MP3" | "AAC" | "OGG" | "OPUS" | "FLAC" | "WAV" | "ALAC" | "";
@@ -72,6 +73,7 @@ const defaultSettings: FlatAppSettings = {
deezer: "",
deezerQuality: "MP3_128",
maxConcurrentDownloads: 3,
utilityConcurrency: 1,
realTime: false,
fallback: false,
convertTo: "",
@@ -135,6 +137,7 @@ const fetchSettings = async (): Promise<FlatAppSettings> => {
// Ensure required frontend-only fields exist
recursiveQuality: Boolean((camelData as any).recursiveQuality ?? false),
realTimeMultiplier: Number((camelData as any).realTimeMultiplier ?? 0),
utilityConcurrency: Number((camelData as any).utilityConcurrency ?? 1),
// Ensure watch subkeys default if missing
watch: {
...(camelData.watch as any),