Compare commits
2 commits
main
...
handle_dou
Author | SHA1 | Date | |
---|---|---|---|
![]() |
64a02bbc4a | ||
![]() |
da4aa1b1b2 |
3 changed files with 18 additions and 3 deletions
|
@ -13,6 +13,7 @@ import "package:photos/service_locator.dart";
|
|||
import 'package:photos/utils/date_time_util.dart';
|
||||
import 'package:photos/utils/exif_util.dart';
|
||||
import 'package:photos/utils/file_uploader_util.dart';
|
||||
import "package:photos/utils/parse.dart";
|
||||
|
||||
//Todo: files with no location data have lat and long set to 0.0. This should ideally be null.
|
||||
class EnteFile {
|
||||
|
@ -131,8 +132,9 @@ class EnteFile {
|
|||
localID = metadata["localID"];
|
||||
title = metadata["title"];
|
||||
deviceFolder = metadata["deviceFolder"];
|
||||
creationTime = metadata["creationTime"] ?? 0;
|
||||
modificationTime = metadata["modificationTime"] ?? creationTime;
|
||||
creationTime = parseKeyAsInt(metadata, "creationTime", 0);
|
||||
modificationTime =
|
||||
parseKeyAsInt(metadata, "modificationTime", creationTime!);
|
||||
final latitude = double.tryParse(metadata["latitude"].toString());
|
||||
final longitude = double.tryParse(metadata["longitude"].toString());
|
||||
if (latitude == null || longitude == null) {
|
||||
|
|
13
mobile/lib/utils/parse.dart
Normal file
13
mobile/lib/utils/parse.dart
Normal file
|
@ -0,0 +1,13 @@
|
|||
import "package:flutter/foundation.dart";
|
||||
|
||||
int parseKeyAsInt(Map<String, dynamic> map, String key, int defaultValue) {
|
||||
try {
|
||||
return map[key] ?? defaultValue;
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print("Error parsing key $key as int: $e");
|
||||
}
|
||||
final double val = map[key] as double;
|
||||
return val.toInt();
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@ description: ente photos application
|
|||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
|
||||
version: 0.8.106+630
|
||||
version: 0.8.108+632
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
|
|
Loading…
Add table
Reference in a new issue