Add new server settings

This commit is contained in:
2024-02-17 21:47:24 +08:00
parent 7cec3fd320
commit f9e920cc57
5 changed files with 32 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ class Config {
required this.ffprobePath,
required this.redirectToFlutter,
required this.downloadTimeoutCheckInterval,
required this.ehMetadataCacheTime,
});
bool cookies;
@JsonKey(name: 'db_path')
@@ -93,6 +94,8 @@ class Config {
bool redirectToFlutter;
@JsonKey(name: 'download_timeout_check_interval')
int downloadTimeoutCheckInterval;
@JsonKey(name: "eh_metadata_cache_time")
int ehMetadataCacheTime;
factory Config.fromJson(Map<String, dynamic> json) => _$ConfigFromJson(json);
Map<String, dynamic> toJson() => _$ConfigToJson(this);
}
@@ -141,6 +144,7 @@ class ConfigOptional {
this.ffprobePath,
this.redirectToFlutter,
this.downloadTimeoutCheckInterval,
this.ehMetadataCacheTime,
});
String? cookies;
@JsonKey(name: 'db_path')
@@ -193,6 +197,8 @@ class ConfigOptional {
bool? redirectToFlutter;
@JsonKey(name: 'download_timeout_check_interval')
int? downloadTimeoutCheckInterval;
@JsonKey(name: "eh_metadata_cache_time")
int? ehMetadataCacheTime;
factory ConfigOptional.fromJson(Map<String, dynamic> json) =>
_$ConfigOptionalFromJson(json);
Map<String, dynamic> toJson() => _$ConfigOptionalToJson(this);

View File

@@ -42,6 +42,7 @@ Config _$ConfigFromJson(Map<String, dynamic> json) => Config(
redirectToFlutter: json['redirect_to_flutter'] as bool,
downloadTimeoutCheckInterval:
json['download_timeout_check_interval'] as int,
ehMetadataCacheTime: json['eh_metadata_cache_time'] as int,
);
Map<String, dynamic> _$ConfigToJson(Config instance) => <String, dynamic>{
@@ -74,6 +75,7 @@ Map<String, dynamic> _$ConfigToJson(Config instance) => <String, dynamic>{
'ffprobe_path': instance.ffprobePath,
'redirect_to_flutter': instance.redirectToFlutter,
'download_timeout_check_interval': instance.downloadTimeoutCheckInterval,
'eh_metadata_cache_time': instance.ehMetadataCacheTime,
};
const _$ThumbnailMethodEnumMap = {
@@ -128,6 +130,7 @@ ConfigOptional _$ConfigOptionalFromJson(Map<String, dynamic> json) =>
redirectToFlutter: json['redirect_to_flutter'] as bool?,
downloadTimeoutCheckInterval:
json['download_timeout_check_interval'] as int?,
ehMetadataCacheTime: json['eh_metadata_cache_time'] as int?,
);
Map<String, dynamic> _$ConfigOptionalToJson(ConfigOptional instance) =>
@@ -161,4 +164,5 @@ Map<String, dynamic> _$ConfigOptionalToJson(ConfigOptional instance) =>
'ffprobe_path': instance.ffprobePath,
'redirect_to_flutter': instance.redirectToFlutter,
'download_timeout_check_interval': instance.downloadTimeoutCheckInterval,
'eh_metadata_cache_time': instance.ehMetadataCacheTime,
};