mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-09 01:50:30 +00:00
feat: add auto-start incomplete tasks on application startup (#1203)
This commit is contained in:
1 parent
24db9bb58b
commit
71c9e6947a
13 files changed
+50
-8
No files matched your search
@@ -84,6 +84,7 @@ class ExtraConfig {
|
||||
bool defaultDirectDownload;
|
||||
bool defaultBtClient;
|
||||
bool notifyWhenNewVersion;
|
||||
bool autoStartTasks;
|
||||
List<DownloadCategory> downloadCategories;
|
||||
|
||||
ExtraConfigBt bt = ExtraConfigBt();
|
||||
@@ -96,6 +97,7 @@ class ExtraConfig {
|
||||
this.defaultDirectDownload = false,
|
||||
this.defaultBtClient = true,
|
||||
this.notifyWhenNewVersion = true,
|
||||
this.autoStartTasks = false,
|
||||
this.downloadCategories = const [],
|
||||
});
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ ExtraConfig _$ExtraConfigFromJson(Map<String, dynamic> json) => ExtraConfig(
|
||||
defaultDirectDownload: json['defaultDirectDownload'] as bool? ?? false,
|
||||
defaultBtClient: json['defaultBtClient'] as bool? ?? true,
|
||||
notifyWhenNewVersion: json['notifyWhenNewVersion'] as bool? ?? true,
|
||||
autoStartTasks: json['autoStartTasks'] as bool? ?? false,
|
||||
downloadCategories: (json['downloadCategories'] as List<dynamic>?)
|
||||
?.map((e) => DownloadCategory.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
@@ -98,6 +99,7 @@ Map<String, dynamic> _$ExtraConfigToJson(ExtraConfig instance) =>
|
||||
'defaultDirectDownload': instance.defaultDirectDownload,
|
||||
'defaultBtClient': instance.defaultBtClient,
|
||||
'notifyWhenNewVersion': instance.notifyWhenNewVersion,
|
||||
'autoStartTasks': instance.autoStartTasks,
|
||||
'downloadCategories':
|
||||
instance.downloadCategories.map((e) => e.toJson()).toList(),
|
||||
'bt': instance.bt.toJson(),
|
||||
|
||||
@@ -53,14 +53,6 @@ const _$ProtocolEnumMap = {
|
||||
Protocol.bt: 'bt',
|
||||
};
|
||||
|
||||
const _$ExtractStatusEnumMap = {
|
||||
ExtractStatus.none: '',
|
||||
ExtractStatus.extracting: 'extracting',
|
||||
ExtractStatus.done: 'done',
|
||||
ExtractStatus.error: 'error',
|
||||
ExtractStatus.waitingParts: 'waitingParts',
|
||||
};
|
||||
|
||||
Progress _$ProgressFromJson(Map<String, dynamic> json) => Progress(
|
||||
used: (json['used'] as num).toInt(),
|
||||
speed: (json['speed'] as num).toInt(),
|
||||
@@ -82,3 +74,11 @@ Map<String, dynamic> _$ProgressToJson(Progress instance) => <String, dynamic>{
|
||||
'extractStatus': _$ExtractStatusEnumMap[instance.extractStatus]!,
|
||||
'extractProgress': instance.extractProgress,
|
||||
};
|
||||
|
||||
const _$ExtractStatusEnumMap = {
|
||||
ExtractStatus.none: '',
|
||||
ExtractStatus.extracting: 'extracting',
|
||||
ExtractStatus.done: 'done',
|
||||
ExtractStatus.error: 'error',
|
||||
ExtractStatus.waitingParts: 'waitingParts',
|
||||
};
|
||||
Reference in new issue
Block a user