1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-10 23:22:22 +02:00

Add timezone to exif entity (#1894)

* Add timezone to exif entity

* Refactor logging

---------

Co-authored-by: Andrea Alemani <andrea.alemani94@gmail.com>
This commit is contained in:
AndreAle94
2023-04-02 21:11:24 +02:00
committed by GitHub
parent 8b001b87d2
commit 94b2ea9b5f
11 changed files with 93 additions and 13 deletions

View File

@@ -17,6 +17,7 @@ Name | Type | Description | Notes
**orientation** | **String** | | [optional]
**dateTimeOriginal** | [**DateTime**](DateTime.md) | | [optional]
**modifyDate** | [**DateTime**](DateTime.md) | | [optional]
**timeZone** | **String** | | [optional]
**lensModel** | **String** | | [optional]
**fNumber** | **num** | | [optional]
**focalLength** | **num** | | [optional]

View File

@@ -22,6 +22,7 @@ class ExifResponseDto {
this.orientation,
this.dateTimeOriginal,
this.modifyDate,
this.timeZone,
this.lensModel,
this.fNumber,
this.focalLength,
@@ -52,6 +53,8 @@ class ExifResponseDto {
DateTime? modifyDate;
String? timeZone;
String? lensModel;
num? fNumber;
@@ -83,6 +86,7 @@ class ExifResponseDto {
other.orientation == orientation &&
other.dateTimeOriginal == dateTimeOriginal &&
other.modifyDate == modifyDate &&
other.timeZone == timeZone &&
other.lensModel == lensModel &&
other.fNumber == fNumber &&
other.focalLength == focalLength &&
@@ -106,6 +110,7 @@ class ExifResponseDto {
(orientation == null ? 0 : orientation!.hashCode) +
(dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) +
(modifyDate == null ? 0 : modifyDate!.hashCode) +
(timeZone == null ? 0 : timeZone!.hashCode) +
(lensModel == null ? 0 : lensModel!.hashCode) +
(fNumber == null ? 0 : fNumber!.hashCode) +
(focalLength == null ? 0 : focalLength!.hashCode) +
@@ -118,7 +123,7 @@ class ExifResponseDto {
(country == null ? 0 : country!.hashCode);
@override
String toString() => 'ExifResponseDto[fileSizeInByte=$fileSizeInByte, make=$make, model=$model, imageName=$imageName, exifImageWidth=$exifImageWidth, exifImageHeight=$exifImageHeight, orientation=$orientation, dateTimeOriginal=$dateTimeOriginal, modifyDate=$modifyDate, lensModel=$lensModel, fNumber=$fNumber, focalLength=$focalLength, iso=$iso, exposureTime=$exposureTime, latitude=$latitude, longitude=$longitude, city=$city, state=$state, country=$country]';
String toString() => 'ExifResponseDto[fileSizeInByte=$fileSizeInByte, make=$make, model=$model, imageName=$imageName, exifImageWidth=$exifImageWidth, exifImageHeight=$exifImageHeight, orientation=$orientation, dateTimeOriginal=$dateTimeOriginal, modifyDate=$modifyDate, timeZone=$timeZone, lensModel=$lensModel, fNumber=$fNumber, focalLength=$focalLength, iso=$iso, exposureTime=$exposureTime, latitude=$latitude, longitude=$longitude, city=$city, state=$state, country=$country]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -167,6 +172,11 @@ class ExifResponseDto {
} else {
// json[r'modifyDate'] = null;
}
if (this.timeZone != null) {
json[r'timeZone'] = this.timeZone;
} else {
// json[r'timeZone'] = null;
}
if (this.lensModel != null) {
json[r'lensModel'] = this.lensModel;
} else {
@@ -252,6 +262,7 @@ class ExifResponseDto {
orientation: mapValueOfType<String>(json, r'orientation'),
dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', ''),
modifyDate: mapDateTime(json, r'modifyDate', ''),
timeZone: mapValueOfType<String>(json, r'timeZone'),
lensModel: mapValueOfType<String>(json, r'lensModel'),
fNumber: json[r'fNumber'] == null
? null

View File

@@ -61,6 +61,11 @@ void main() {
// TODO
});
// String timeZone
test('to test the property `timeZone`', () async {
// TODO
});
// String lensModel
test('to test the property `lensModel`', () async {
// TODO