feat: add config for auto-torrent (#1219)

This commit is contained in:
Copilot authored and GitHub committed 2026-01-22 22:18:34 +08:00
1 parent a3c1f84c2c
commit 7b840b4261
31 files changed
+742 -131

No files matched your search

@@ -10,11 +10,11 @@ class DownloaderConfig {
ExtraConfig extra = ExtraConfig();
ProxyConfig proxy = ProxyConfig();
WebhookConfig webhook = WebhookConfig();
AutoTorrentConfig autoTorrent = AutoTorrentConfig();
ArchiveConfig archive = ArchiveConfig();
// New fields for auto-management
bool autoDeleteTorrents = false;
bool autoCleanMissingFiles = false;
bool autoDeleteMissingFileTasks = false;
DownloaderConfig({
this.downloadDir = '',
@@ -234,6 +234,22 @@ class ExtraConfigGithubMirror {
Map<String, dynamic> toJson() => _$ExtraConfigGithubMirrorToJson(this);
}
@JsonSerializable()
class AutoTorrentConfig {
bool enable;
bool deleteAfterDownload;
AutoTorrentConfig({
this.enable = false,
this.deleteAfterDownload = false,
});
factory AutoTorrentConfig.fromJson(Map<String, dynamic>? json) =>
json == null ? AutoTorrentConfig() : _$AutoTorrentConfigFromJson(json);
Map<String, dynamic> toJson() => _$AutoTorrentConfigToJson(this);
}
@JsonSerializable()
class ArchiveConfig {
bool autoExtract;
@@ -248,4 +264,4 @@ class ArchiveConfig {
json == null ? ArchiveConfig() : _$ArchiveConfigFromJson(json);
Map<String, dynamic> toJson() => _$ArchiveConfigToJson(this);
}
}