add new server settings

This commit is contained in:
2024-02-06 17:38:49 +08:00
parent 2fab2f56d8
commit 4eb43cfbca
5 changed files with 36 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ class Config {
required this.downloadTimeout,
required this.ffprobePath,
required this.redirectToFlutter,
required this.downloadTimeoutCheckInterval,
});
bool cookies;
@JsonKey(name: 'db_path')
@@ -90,6 +91,8 @@ class Config {
String ffprobePath;
@JsonKey(name: 'redirect_to_flutter')
bool redirectToFlutter;
@JsonKey(name: 'download_timeout_check_interval')
int downloadTimeoutCheckInterval;
factory Config.fromJson(Map<String, dynamic> json) => _$ConfigFromJson(json);
Map<String, dynamic> toJson() => _$ConfigToJson(this);
}
@@ -137,6 +140,7 @@ class ConfigOptional {
this.downloadTimeout,
this.ffprobePath,
this.redirectToFlutter,
this.downloadTimeoutCheckInterval,
});
String? cookies;
@JsonKey(name: 'db_path')
@@ -187,6 +191,8 @@ class ConfigOptional {
String? ffprobePath;
@JsonKey(name: 'redirect_to_flutter')
bool? redirectToFlutter;
@JsonKey(name: 'download_timeout_check_interval')
int? downloadTimeoutCheckInterval;
factory ConfigOptional.fromJson(Map<String, dynamic> json) =>
_$ConfigOptionalFromJson(json);
Map<String, dynamic> toJson() => _$ConfigOptionalToJson(this);

View File

@@ -40,6 +40,8 @@ Config _$ConfigFromJson(Map<String, dynamic> json) => Config(
downloadTimeout: json['download_timeout'] as int,
ffprobePath: json['ffprobe_path'] as String,
redirectToFlutter: json['redirect_to_flutter'] as bool,
downloadTimeoutCheckInterval:
json['download_timeout_check_interval'] as int,
);
Map<String, dynamic> _$ConfigToJson(Config instance) => <String, dynamic>{
@@ -71,6 +73,7 @@ Map<String, dynamic> _$ConfigToJson(Config instance) => <String, dynamic>{
'download_timeout': instance.downloadTimeout,
'ffprobe_path': instance.ffprobePath,
'redirect_to_flutter': instance.redirectToFlutter,
'download_timeout_check_interval': instance.downloadTimeoutCheckInterval,
};
const _$ThumbnailMethodEnumMap = {
@@ -123,6 +126,8 @@ ConfigOptional _$ConfigOptionalFromJson(Map<String, dynamic> json) =>
downloadTimeout: json['download_timeout'] as int?,
ffprobePath: json['ffprobe_path'] as String?,
redirectToFlutter: json['redirect_to_flutter'] as bool?,
downloadTimeoutCheckInterval:
json['download_timeout_check_interval'] as int?,
);
Map<String, dynamic> _$ConfigOptionalToJson(ConfigOptional instance) =>
@@ -155,4 +160,5 @@ Map<String, dynamic> _$ConfigOptionalToJson(ConfigOptional instance) =>
'download_timeout': instance.downloadTimeout,
'ffprobe_path': instance.ffprobePath,
'redirect_to_flutter': instance.redirectToFlutter,
'download_timeout_check_interval': instance.downloadTimeoutCheckInterval,
};