fix!: set duration to null when not present (#26982)

This commit is contained in:
Mees Frensel
2026-04-17 11:57:10 +02:00
committed by GitHub
parent 2172dde7dc
commit 7d181f0686
15 changed files with 31 additions and 27 deletions
+8 -4
View File
@@ -57,8 +57,8 @@ class AssetResponseDto {
/// Duplicate group ID
String? duplicateId;
/// Video duration (for videos)
String duration;
/// Video/gif duration in hh:mm:ss.SSS format (null for static images)
String? duration;
///
/// Please note: This property should have been non-nullable! Since the specification file
@@ -209,7 +209,7 @@ class AssetResponseDto {
(checksum.hashCode) +
(createdAt.hashCode) +
(duplicateId == null ? 0 : duplicateId!.hashCode) +
(duration.hashCode) +
(duration == null ? 0 : duration!.hashCode) +
(exifInfo == null ? 0 : exifInfo!.hashCode) +
(fileCreatedAt.hashCode) +
(fileModifiedAt.hashCode) +
@@ -252,7 +252,11 @@ class AssetResponseDto {
} else {
// json[r'duplicateId'] = null;
}
if (this.duration != null) {
json[r'duration'] = this.duration;
} else {
// json[r'duration'] = null;
}
if (this.exifInfo != null) {
json[r'exifInfo'] = this.exifInfo;
} else {
@@ -337,7 +341,7 @@ class AssetResponseDto {
checksum: mapValueOfType<String>(json, r'checksum')!,
createdAt: mapDateTime(json, r'createdAt', r'')!,
duplicateId: mapValueOfType<String>(json, r'duplicateId'),
duration: mapValueOfType<String>(json, r'duration')!,
duration: mapValueOfType<String>(json, r'duration'),
exifInfo: ExifResponseDto.fromJson(json[r'exifInfo']),
fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r'')!,
fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r'')!,
@@ -39,7 +39,7 @@ class TimeBucketAssetResponseDto {
/// Array of country names extracted from EXIF GPS data
List<String?> country;
/// Array of video durations in HH:MM:SS format (null for images)
/// Array of video/gif durations in hh:mm:ss.SSS format (null for static images)
List<String?> duration;
/// Array of file creation timestamps in UTC