feat: support download client priority

This commit is contained in:
Simon Ding
2024-10-04 11:12:06 +08:00
parent 7dfa4eafc4
commit 3af5f96cb0
13 changed files with 172 additions and 155 deletions

View File

@@ -243,6 +243,7 @@ class DownloadClient {
String? password;
bool? removeCompletedDownloads;
bool? removeFailedDownloads;
int? priority;
DownloadClient(
{this.id,
this.enable,
@@ -252,6 +253,7 @@ class DownloadClient {
this.user,
this.password,
this.removeCompletedDownloads = true,
this.priority = 1,
this.removeFailedDownloads = true});
DownloadClient.fromJson(Map<String, dynamic> json) {
@@ -262,6 +264,7 @@ class DownloadClient {
url = json['url'];
user = json['user'];
password = json['password'];
priority = json["priority1"];
removeCompletedDownloads = json["remove_completed_downloads"] ?? false;
removeFailedDownloads = json["remove_failed_downloads"] ?? false;
}
@@ -275,6 +278,7 @@ class DownloadClient {
data['url'] = url;
data['user'] = user;
data['password'] = password;
data["priority"] = priority;
data["remove_completed_downloads"] = removeCompletedDownloads;
data["remove_failed_downloads"] = removeFailedDownloads;
return data;