fix(mobile): use JSON maps for nested config compatibility defaults
This commit is contained in:
@@ -34,7 +34,9 @@ final Map<String, Map<String, Object?>> openApiPatches = {
|
||||
lightStyle: 'https://tiles.immich.cloud/v1/style/light.json',
|
||||
darkStyle: 'https://tiles.immich.cloud/v1/style/dark.json',
|
||||
).toJson(),
|
||||
'ffmpeg': PublicConfigFFmpegDto(realtime: PublicConfigFFmpegRealtimeDto(enabled: false)).toJson(),
|
||||
'ffmpeg': {
|
||||
'realtime': {'enabled': false},
|
||||
},
|
||||
},
|
||||
'ServerConfigDto': {
|
||||
'mapLightStyleUrl': 'https://tiles.immich.cloud/v1/style/light.json',
|
||||
@@ -53,7 +55,11 @@ final Map<String, Map<String, Object?>> openApiPatches = {
|
||||
'PeopleResponse': {'updateStrategy': 'everyone'},
|
||||
'PersonResponseDto': {'otherPeople': const [], 'sharedBy': const [], 'sharedWith': const []},
|
||||
'ServerVersionResponseDto': {'featureLevel': 0},
|
||||
'UserConfigDto': {'notifications': UserConfigNotificationsDto(smtp: UserConfigSmtpDto(enabled: false)).toJson()},
|
||||
'UserConfigDto': {
|
||||
'notifications': {
|
||||
'smtp': {'enabled': false},
|
||||
},
|
||||
},
|
||||
'WorkflowResponseDto': {'logging': false},
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:openapi/api.dart';
|
||||
void main() {
|
||||
group('Test OpenApi Patching', () {
|
||||
test('older public config deserializes with map and video defaults', () {
|
||||
final config = PublicConfigDto.fromJson({
|
||||
final config = PublicConfigDto.fromJson(<String, dynamic>{
|
||||
'oauth': {'autoLaunch': false, 'buttonText': 'Login', 'enabled': false},
|
||||
'passwordLogin': {'enabled': true},
|
||||
'server': {'loginPageMessage': ''},
|
||||
@@ -19,7 +19,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('public config keeps explicit server map and video settings', () {
|
||||
final config = PublicConfigDto.fromJson({
|
||||
final config = PublicConfigDto.fromJson(<String, dynamic>{
|
||||
'oauth': {'autoLaunch': false, 'buttonText': 'Login', 'enabled': false},
|
||||
'passwordLogin': {'enabled': true},
|
||||
'server': {'loginPageMessage': ''},
|
||||
|
||||
Reference in New Issue
Block a user