Add new settings

This commit is contained in:
2024-02-03 14:05:15 +08:00
parent 08633de69c
commit 36b0bc38c9
6 changed files with 73 additions and 38 deletions

View File

@@ -39,6 +39,7 @@ class Config {
required this.fetchTimeout,
required this.downloadTimeout,
required this.ffprobePath,
required this.redirectToFlutter,
});
bool cookies;
@JsonKey(name: 'db_path')
@@ -87,6 +88,8 @@ class Config {
int downloadTimeout;
@JsonKey(name: 'ffprobe_path')
String ffprobePath;
@JsonKey(name: 'redirect_to_flutter')
bool redirectToFlutter;
factory Config.fromJson(Map<String, dynamic> json) => _$ConfigFromJson(json);
Map<String, dynamic> toJson() => _$ConfigToJson(this);
}
@@ -133,6 +136,7 @@ class ConfigOptional {
this.fetchTimeout,
this.downloadTimeout,
this.ffprobePath,
this.redirectToFlutter,
});
String? cookies;
@JsonKey(name: 'db_path')
@@ -181,6 +185,8 @@ class ConfigOptional {
int? downloadTimeout;
@JsonKey(name: 'ffprobe_path')
String? ffprobePath;
@JsonKey(name: 'redirect_to_flutter')
bool? redirectToFlutter;
factory ConfigOptional.fromJson(Map<String, dynamic> json) =>
_$ConfigOptionalFromJson(json);
Map<String, dynamic> toJson() => _$ConfigOptionalToJson(this);

View File

@@ -39,6 +39,7 @@ Config _$ConfigFromJson(Map<String, dynamic> json) => Config(
fetchTimeout: json['fetch_timeout'] as int,
downloadTimeout: json['download_timeout'] as int,
ffprobePath: json['ffprobe_path'] as String,
redirectToFlutter: json['redirect_to_flutter'] as bool,
);
Map<String, dynamic> _$ConfigToJson(Config instance) => <String, dynamic>{
@@ -69,6 +70,7 @@ Map<String, dynamic> _$ConfigToJson(Config instance) => <String, dynamic>{
'fetch_timeout': instance.fetchTimeout,
'download_timeout': instance.downloadTimeout,
'ffprobe_path': instance.ffprobePath,
'redirect_to_flutter': instance.redirectToFlutter,
};
const _$ThumbnailMethodEnumMap = {
@@ -120,6 +122,7 @@ ConfigOptional _$ConfigOptionalFromJson(Map<String, dynamic> json) =>
fetchTimeout: json['fetch_timeout'] as int?,
downloadTimeout: json['download_timeout'] as int?,
ffprobePath: json['ffprobe_path'] as String?,
redirectToFlutter: json['redirect_to_flutter'] as bool?,
);
Map<String, dynamic> _$ConfigOptionalToJson(ConfigOptional instance) =>
@@ -151,4 +154,5 @@ Map<String, dynamic> _$ConfigOptionalToJson(ConfigOptional instance) =>
'fetch_timeout': instance.fetchTimeout,
'download_timeout': instance.downloadTimeout,
'ffprobe_path': instance.ffprobePath,
'redirect_to_flutter': instance.redirectToFlutter,
};