Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob] Add support for parsing dateTime & offsetTime from pubMagicMetadata

Neeraj Guptac20dcdae76a6
diff --git a/mobile/lib/models/metadata/file_magic.dart b/mobile/lib/models/metadata/file_magic.dart
index 7599b7c82f..02f6188a9d 100644
--- a/mobile/lib/models/metadata/file_magic.dart
+++ b/mobile/lib/models/metadata/file_magic.dart
@@ -14,6 +14,8 @@ const latKey = "lat";
const longKey = "long";
const motionVideoIndexKey = "mvi";
const noThumbKey = "noThumb";
+const dateTimeKey = 'dateTime';
+const offsetTimeKey = 'offsetTime';
class MagicMetadata {
// 0 -> visible
@@ -46,6 +48,11 @@ class PubMagicMetadata {
double? lat;
double? long;
+ // ISO 8601 datetime without timezone. This contains the date and time of the photo in the original tz
+ // where the photo was taken.
+ String? dateTime;
+ String? offsetTime;
+
// Motion Video Index. Positive value (>0) indicates that the file is a motion
// photo
int? mvi;
@@ -74,6 +81,8 @@ class PubMagicMetadata {
this.mvi,
this.noThumb,
this.mediaType,
+ this.dateTime,
+ this.offsetTime,
});
factory PubMagicMetadata.fromEncodedJson(String encodedJson) =>
@@ -96,6 +105,8 @@ class PubMagicMetadata {
mvi: map[motionVideoIndexKey],
noThumb: map[noThumbKey],
mediaType: map[mediaTypeKey],
+ dateTime: map[dateTimeKey],
+ offsetTime: map[offsetTimeKey],
);
}