mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-14 12:23:43 +00:00
feat(bt): support disabling DHT and PEX (#1555)
This commit is contained in:
1 parent
eee39e012f
commit
5462b14705
30 files changed
+149
No files matched your search
@@ -105,6 +105,8 @@ class BtConfig {
|
||||
bool seedKeep;
|
||||
double seedRatio;
|
||||
int seedTime;
|
||||
bool disableDht;
|
||||
bool disablePex;
|
||||
|
||||
BtConfig({
|
||||
this.listenPort = 0,
|
||||
@@ -112,6 +114,8 @@ class BtConfig {
|
||||
this.seedKeep = false,
|
||||
this.seedRatio = 0,
|
||||
this.seedTime = 0,
|
||||
this.disableDht = false,
|
||||
this.disablePex = false,
|
||||
});
|
||||
|
||||
factory BtConfig.fromJson(Map<String, dynamic> json) => _$BtConfigFromJson(json);
|
||||
|
||||
@@ -98,6 +98,8 @@ BtConfig _$BtConfigFromJson(Map<String, dynamic> json) => BtConfig(
|
||||
seedKeep: json['seedKeep'] as bool? ?? false,
|
||||
seedRatio: (json['seedRatio'] as num?)?.toDouble() ?? 0,
|
||||
seedTime: (json['seedTime'] as num?)?.toInt() ?? 0,
|
||||
disableDht: json['disableDht'] as bool? ?? false,
|
||||
disablePex: json['disablePex'] as bool? ?? false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BtConfigToJson(BtConfig instance) => <String, dynamic>{
|
||||
@@ -106,6 +108,8 @@ Map<String, dynamic> _$BtConfigToJson(BtConfig instance) => <String, dynamic>{
|
||||
'seedKeep': instance.seedKeep,
|
||||
'seedRatio': instance.seedRatio,
|
||||
'seedTime': instance.seedTime,
|
||||
'disableDht': instance.disableDht,
|
||||
'disablePex': instance.disablePex,
|
||||
};
|
||||
|
||||
Ed2kConfig _$Ed2kConfigFromJson(Map<String, dynamic> json) => Ed2kConfig(
|
||||
|
||||
Reference in new issue
Block a user