From 408adebf8e6d116a731088e8e9a7a90dbbe18851 Mon Sep 17 00:00:00 2001 From: Marinus Schraal Date: Sat, 5 Sep 2020 18:18:04 +0200 Subject: tracker3: Fix PUBLICATION_DATE writeback be263953d7 introduced the use of the PUBLICATION_DATE key. The sparql variable name for writeback however should be publicationDate to work. The writeback resource builder should deal with the "publication date" metadata key as well. Related: !90 --- src/tracker3/grl-tracker-utils.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tracker3/grl-tracker-utils.c b/src/tracker3/grl-tracker-utils.c index fc83a86..53aef81 100644 --- a/src/tracker3/grl-tracker-utils.c +++ b/src/tracker3/grl-tracker-utils.c @@ -356,7 +356,7 @@ grl_tracker_setup_key_mappings (void) set_date); insert_key_mapping_with_setter (GRL_METADATA_KEY_PUBLICATION_DATE, - "creationDate", + "publicationDate", "nie:contentCreated(?urn)", GRL_TYPE_FILTER_ALL, set_date); @@ -586,6 +586,14 @@ grl_tracker_build_resource_from_media (GrlMedia *media, GList *keys) date = g_date_time_format_iso8601 (creation); tracker_resource_set_string (resource, "nie:contentCreated", date); g_free (date); + } else if (l->data == GRLKEYID_TO_POINTER (GRL_METADATA_KEY_PUBLICATION_DATE)) { + GDateTime *publication; + gchar *date; + + publication = grl_media_get_publication_date (media); + date = g_date_time_format_iso8601 (publication); + tracker_resource_set_string (resource, "nie:contentCreated", date); + g_free (date); } else if (l->data == GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ALBUM)) { TrackerResource *album; album = ensure_resource_for_property (resource, "nmm:musicAlbum", FALSE); -- cgit v1.2.1