π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mobile][photos] Fix missing location lookup
Priyanshu Dangarea50cafab4569
diff --git a/mobile/apps/photos/lib/module/upload/upload_data.dart b/mobile/apps/photos/lib/module/upload/upload_data.dartindex 7a7d964747..cb46001a4c 100644--- a/mobile/apps/photos/lib/module/upload/upload_data.dart+++ b/mobile/apps/photos/lib/module/upload/upload_data.dart@@ -271,13 +271,14 @@ Future<void> _decorateEnteFileData(Map<String, IfdTag>? exifData,) async {// h4ck to fetch location data if missing (thank you Android Q+) lazily only during uploads- if (file.location == null ||- (file.location!.latitude == 0 && file.location!.longitude == 0)) {+ if (!file.hasLocation) {final latLong = await asset.latlngAsync();- file.location = Location(- latitude: latLong?.latitude,- longitude: latLong?.longitude,- );+ if (latLong != null) {+ file.location = Location(+ latitude: latLong.latitude,+ longitude: latLong.longitude,+ );+ }}await updateLocationFromEmbeddedMetadata(file, sourceFile, exifData);if (Platform.isIOS) {diff --git a/mobile/apps/photos/lib/services/sync/offline_import_metadata_service.dart b/mobile/apps/photos/lib/services/sync/offline_import_metadata_service.dartindex 1a9506e159..5fe78bdd38 100644--- a/mobile/apps/photos/lib/services/sync/offline_import_metadata_service.dart+++ b/mobile/apps/photos/lib/services/sync/offline_import_metadata_service.dart@@ -151,10 +151,12 @@ class OfflineImportMetadataService {final asset = await file.getAsset;if (asset != null) {final latLong = await asset.latlngAsync();- file.location = Location(- latitude: latLong?.latitude,- longitude: latLong?.longitude,- );+ if (latLong != null) {+ file.location = Location(+ latitude: latLong.latitude,+ longitude: latLong.longitude,+ );+ }}}diff --git a/mobile/apps/photos/lib/ui/tools/editor/video_editor_page.dart b/mobile/apps/photos/lib/ui/tools/editor/video_editor_page.dartindex a2eafea875..4fb3355738 100644--- a/mobile/apps/photos/lib/ui/tools/editor/video_editor_page.dart+++ b/mobile/apps/photos/lib/ui/tools/editor/video_editor_page.dart@@ -578,10 +578,12 @@ class _VideoEditorPageState extends State<VideoEditorPage> {final assetEntity = await widget.file.getAsset;if (assetEntity != null) {final latLong = await assetEntity.latlngAsync();- newFile.location = Location(- latitude: latLong?.latitude,- longitude: latLong?.longitude,- );+ if (latLong != null) {+ newFile.location = Location(+ latitude: latLong.latitude,+ longitude: latLong.longitude,+ );+ }}}