1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

fix(mobile) invalid creation time on local asset show 1970 as year (#1391)

This commit is contained in:
Alex 2023-01-22 22:33:47 -06:00 committed by GitHub
parent 83271bb11e
commit 171ba84741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 2 deletions

View File

@ -32,8 +32,16 @@ class Asset {
double? get longitude =>
isLocal ? local!.longitude : remote!.exifInfo?.longitude?.toDouble();
DateTime get createdAt =>
isLocal ? local!.createDateTime : DateTime.parse(remote!.createdAt);
DateTime get createdAt {
if (isLocal) {
if (local!.createDateTime.year == 1970) {
return local!.modifiedDateTime;
}
return local!.createDateTime;
} else {
return DateTime.parse(remote!.createdAt);
}
}
bool get isImage => isLocal
? local!.type == AssetType.image

View File

@ -307,6 +307,11 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0"
flutter_driver:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
flutter_hooks:
dependency: "direct main"
description:
@ -392,6 +397,11 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
glob:
dependency: transitive
description:
@ -504,6 +514,11 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
integration_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
intl:
dependency: "direct main"
description:
@ -1041,6 +1056,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
sync_http:
dependency: transitive
description:
name: sync_http
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.1"
synchronized:
dependency: transitive
description:
@ -1202,6 +1224,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.10"
vm_service:
dependency: transitive
description:
name: vm_service
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.0"
wakelock:
dependency: transitive
description:
@ -1251,6 +1280,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
webdriver:
dependency: transitive
description:
name: webdriver
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
win32:
dependency: transitive
description: