summaryrefslogtreecommitdiff
path: root/src/MetadataWriter.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-14 20:36:17 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-14 20:36:17 +0200
commit31804433d72460cbe0a39f9f8ea5e76058d84cda (patch)
tree2084a84c39f159c6aea254775dc0880d52579d45 /src/MetadataWriter.vala
parenta9898fb3f39c44a85876930ef6b2558052569ae6 (diff)
parentd443a3c2509889533ca812c163056bace396b586 (diff)
Update upstream source from tag 'upstream/0.32.1'
Update to upstream version '0.32.1' with Debian dir c460ad6e13d3c39eaa2d5399059385e64e6fba4c
Diffstat (limited to 'src/MetadataWriter.vala')
-rw-r--r--src/MetadataWriter.vala18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/MetadataWriter.vala b/src/MetadataWriter.vala
index 0c23260..5fc26d1 100644
--- a/src/MetadataWriter.vala
+++ b/src/MetadataWriter.vala
@@ -15,7 +15,7 @@ public class MetadataWriter : Object {
public const uint COMMIT_DELAY_MSEC = 3000;
public const uint COMMIT_SPACING_MSEC = 50;
- private const string[] INTERESTED_PHOTO_METADATA_DETAILS = { "name", "comment", "rating", "exposure-time" };
+ private const string[] INTERESTED_PHOTO_METADATA_DETAILS = { "name", "comment", "rating", "exposure-time", "gps" };
private class CommitJob : BackgroundJob {
public LibraryPhoto photo;
@@ -108,18 +108,26 @@ public class MetadataWriter : Object {
}
// exposure date/time
- time_t current_exposure_time = photo.get_exposure_time();
- time_t metadata_exposure_time = 0;
+ DateTime? current_exposure_time = photo.get_exposure_time();
+ DateTime? metadata_exposure_time = null;
MetadataDateTime? metadata_exposure_date_time = metadata.get_exposure_date_time();
if (metadata_exposure_date_time != null)
metadata_exposure_time = metadata_exposure_date_time.get_timestamp();
if (current_exposure_time != metadata_exposure_time) {
- metadata.set_exposure_date_time(current_exposure_time != 0
+ metadata.set_exposure_date_time(current_exposure_time != null
? new MetadataDateTime(current_exposure_time)
: null);
changed = true;
}
+ // gps location
+ GpsCoords current_gps_coords = photo.get_gps_coords();
+ GpsCoords metadata_gps_coords = metadata.get_gps_coords();
+ if (!current_gps_coords.equals(ref metadata_gps_coords)) {
+ metadata.set_gps_coords(current_gps_coords);
+ changed = true;
+ }
+
// tags (keywords) ... replace (or clear) entirely rather than union or intersection
Gee.Set<string> safe_keywords = new Gee.HashSet<string>();
@@ -681,7 +689,7 @@ public class MetadataWriter : Object {
try {
job.photo.set_master_metadata_dirty(false);
- } catch (DatabaseError err) {
+ } catch (Error err) {
AppWindow.database_error(err);
}