mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 13:38:13 -08:00
chore: Cleanup globalConfig settings
This commit is contained in:
parent
8acd880329
commit
93a38a0b6b
1 changed files with 16 additions and 26 deletions
|
|
@ -12,19 +12,7 @@ class BackgroundDownloader extends _$BackgroundDownloader {
|
|||
final maxDownloads = ref.read(clientSettingsProvider.select((value) => value.maxConcurrentDownloads));
|
||||
return FileDownloader()
|
||||
..configure(
|
||||
globalConfig: maxDownloads == 0
|
||||
? ("", "")
|
||||
: (
|
||||
Config.holdingQueue,
|
||||
(
|
||||
//maxConcurrent
|
||||
maxDownloads,
|
||||
//maxConcurrentByHost
|
||||
maxDownloads,
|
||||
//maxConcurrentByGroup
|
||||
maxDownloads,
|
||||
),
|
||||
),
|
||||
globalConfig: globalConfig(maxDownloads),
|
||||
)
|
||||
..trackTasks()
|
||||
..configureNotification(
|
||||
|
|
@ -37,19 +25,21 @@ class BackgroundDownloader extends _$BackgroundDownloader {
|
|||
|
||||
void setMaxConcurrent(int value) {
|
||||
state.configure(
|
||||
globalConfig: value == 0
|
||||
? ("", "")
|
||||
: (
|
||||
Config.holdingQueue,
|
||||
(
|
||||
//maxConcurrent
|
||||
value,
|
||||
//maxConcurrentByHost
|
||||
value,
|
||||
//maxConcurrentByGroup
|
||||
value,
|
||||
),
|
||||
),
|
||||
globalConfig: globalConfig(value),
|
||||
);
|
||||
}
|
||||
|
||||
(String, dynamic) globalConfig(int value) => value == 0
|
||||
? ("", "")
|
||||
: (
|
||||
Config.holdingQueue,
|
||||
(
|
||||
//maxConcurrent
|
||||
value,
|
||||
//maxConcurrentByHost
|
||||
value,
|
||||
//maxConcurrentByGroup
|
||||
value,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue