Commit c6cf8372 authored by Marinus Schraal's avatar Marinus Schraal Committed by Bastien Nocera
Browse files

tracker3: Fix PUBLICATION_DATE writeback

be263953 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
parent 93bb0349
Pipeline #225796 passed with stage
in 3 minutes and 55 seconds
...@@ -356,7 +356,7 @@ grl_tracker_setup_key_mappings (void) ...@@ -356,7 +356,7 @@ grl_tracker_setup_key_mappings (void)
set_date); set_date);
insert_key_mapping_with_setter (GRL_METADATA_KEY_PUBLICATION_DATE, insert_key_mapping_with_setter (GRL_METADATA_KEY_PUBLICATION_DATE,
"creationDate", "publicationDate",
"nie:contentCreated(?urn)", "nie:contentCreated(?urn)",
GRL_TYPE_FILTER_ALL, GRL_TYPE_FILTER_ALL,
set_date); set_date);
...@@ -586,6 +586,14 @@ grl_tracker_build_resource_from_media (GrlMedia *media, GList *keys) ...@@ -586,6 +586,14 @@ grl_tracker_build_resource_from_media (GrlMedia *media, GList *keys)
date = g_date_time_format_iso8601 (creation); date = g_date_time_format_iso8601 (creation);
tracker_resource_set_string (resource, "nie:contentCreated", date); tracker_resource_set_string (resource, "nie:contentCreated", date);
g_free (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)) { } else if (l->data == GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ALBUM)) {
TrackerResource *album; TrackerResource *album;
album = ensure_resource_for_property (resource, "nmm:musicAlbum", FALSE); album = ensure_resource_for_property (resource, "nmm:musicAlbum", FALSE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment