1
0
mirror of https://github.com/immich-app/immich.git synced 2025-02-01 18:17:51 +02:00
immich/mobile/lib/utils/openapi_patching.dart

18 lines
450 B
Dart
Raw Normal View History

import 'package:openapi/api.dart';
dynamic upgradeDto(dynamic value, String targetType) {
switch (targetType) {
case 'UserPreferencesResponseDto':
if (value is Map) {
if (value['rating'] == null) {
value['rating'] = RatingResponse().toJson();
}
if (value['download']['includeEmbeddedVideos'] == null) {
value['download']['includeEmbeddedVideos'] = false;
}
}
break;
}
}