chore: Cleanup globalConfig settings

This commit is contained in:
PartyDonut 2025-05-18 11:45:21 +02:00
parent 8acd880329
commit 93a38a0b6b

View file

@ -12,19 +12,7 @@ class BackgroundDownloader extends _$BackgroundDownloader {
final maxDownloads = ref.read(clientSettingsProvider.select((value) => value.maxConcurrentDownloads)); final maxDownloads = ref.read(clientSettingsProvider.select((value) => value.maxConcurrentDownloads));
return FileDownloader() return FileDownloader()
..configure( ..configure(
globalConfig: maxDownloads == 0 globalConfig: globalConfig(maxDownloads),
? ("", "")
: (
Config.holdingQueue,
(
//maxConcurrent
maxDownloads,
//maxConcurrentByHost
maxDownloads,
//maxConcurrentByGroup
maxDownloads,
),
),
) )
..trackTasks() ..trackTasks()
..configureNotification( ..configureNotification(
@ -37,7 +25,11 @@ class BackgroundDownloader extends _$BackgroundDownloader {
void setMaxConcurrent(int value) { void setMaxConcurrent(int value) {
state.configure( state.configure(
globalConfig: value == 0 globalConfig: globalConfig(value),
);
}
(String, dynamic) globalConfig(int value) => value == 0
? ("", "") ? ("", "")
: ( : (
Config.holdingQueue, Config.holdingQueue,
@ -49,7 +41,5 @@ class BackgroundDownloader extends _$BackgroundDownloader {
//maxConcurrentByGroup //maxConcurrentByGroup
value, value,
), ),
),
); );
}
} }