mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-08 09:30:27 +00:00
feat: add automatic cleanup options for completed torrents and missing files (#1243)
This commit is contained in:
1 parent
bad7f1d06c
commit
8d33e1a5b3
23 files changed
+152
-6
No files matched your search
@@ -12,6 +12,10 @@ class DownloaderConfig {
|
||||
WebhookConfig webhook = WebhookConfig();
|
||||
ArchiveConfig archive = ArchiveConfig();
|
||||
|
||||
// New fields for auto-management
|
||||
bool autoDeleteTorrents = false;
|
||||
bool autoCleanMissingFiles = false;
|
||||
|
||||
DownloaderConfig({
|
||||
this.downloadDir = '',
|
||||
this.maxRunning = 0,
|
||||
@@ -244,4 +248,4 @@ class ArchiveConfig {
|
||||
json == null ? ArchiveConfig() : _$ArchiveConfigFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ArchiveConfigToJson(this);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,9 @@ DownloaderConfig _$DownloaderConfigFromJson(Map<String, dynamic> json) =>
|
||||
..webhook =
|
||||
WebhookConfig.fromJson(json['webhook'] as Map<String, dynamic>?)
|
||||
..archive =
|
||||
ArchiveConfig.fromJson(json['archive'] as Map<String, dynamic>?);
|
||||
ArchiveConfig.fromJson(json['archive'] as Map<String, dynamic>?)
|
||||
..autoDeleteTorrents = json['autoDeleteTorrents'] as bool
|
||||
..autoCleanMissingFiles = json['autoCleanMissingFiles'] as bool;
|
||||
|
||||
Map<String, dynamic> _$DownloaderConfigToJson(DownloaderConfig instance) =>
|
||||
<String, dynamic>{
|
||||
@@ -29,6 +31,8 @@ Map<String, dynamic> _$DownloaderConfigToJson(DownloaderConfig instance) =>
|
||||
'proxy': instance.proxy.toJson(),
|
||||
'webhook': instance.webhook.toJson(),
|
||||
'archive': instance.archive.toJson(),
|
||||
'autoDeleteTorrents': instance.autoDeleteTorrents,
|
||||
'autoCleanMissingFiles': instance.autoCleanMissingFiles,
|
||||
};
|
||||
|
||||
ProtocolConfig _$ProtocolConfigFromJson(Map<String, dynamic> json) =>
|
||||
|
||||
Reference in new issue
Block a user