feat(http): support advisory extension download sizes (#1599)

This commit is contained in:
Levi authored and GitHub committed 2026-10-22 23:35:01 +08:00
1 parent 4214765d39
commit d125d4ab75
17 files changed
+1047 -182

No files matched your search

+12 -6
View File
@@ -4,13 +4,22 @@ part 'options.g.dart';
@JsonSerializable(explicitToJson: true)
class Options {
/// HTTP-only size estimate, superseded by HTTP metadata or completion.
int size;
String name;
String path;
bool asDefaultPath;
List<int> selectFiles;
Object? extra;
Options({this.name = '', this.path = '', this.asDefaultPath = false, this.selectFiles = const [], this.extra});
Options({
this.size = 0,
this.name = '',
this.path = '',
this.asDefaultPath = false,
this.selectFiles = const [],
this.extra,
});
factory Options.fromJson(Map<String, dynamic> json) => _$OptionsFromJson(json);
@@ -22,17 +31,14 @@ class ChecksumOption {
String algorithm;
String expected;
ChecksumOption({
this.algorithm = '',
this.expected = '',
});
ChecksumOption({this.algorithm = '', this.expected = ''});
factory ChecksumOption.fromJson(Map<String, dynamic> json) => _$ChecksumOptionFromJson(json);
Map<String, dynamic> toJson() => _$ChecksumOptionToJson(this);
}
@JsonSerializable()
@JsonSerializable(explicitToJson: true)
class OptsExtraHttp {
int connections;
bool? autoTorrent;