diff options
author | Marinus Schraal <mschraal@gnome.org> | 2020-09-05 18:18:04 +0200 |
---|---|---|
committer | Marinus Schraal <mschraal@gnome.org> | 2020-10-30 09:42:45 +0100 |
commit | 408adebf8e6d116a731088e8e9a7a90dbbe18851 (patch) | |
tree | f237d8530bba7918c45005db5e4c4575e427639a | |
parent | 7976eb803e96b2d426f906a628e5fa9ee51ec638 (diff) | |
download | grilo-plugins-wip/mschraal/tracker3-publication-date-fix.tar.gz |
tracker3: Fix PUBLICATION_DATE writebackwip/mschraal/tracker3-publication-date-fix
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
-rw-r--r-- | src/tracker3/grl-tracker-utils.c | 10 |
1 files changed, 9 insertions, 1 deletions
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); |