[grilo-plugins] tracker: ensure ID is always obtained



commit c74848fbd102175c845c4958fdb18f6cb17e62c4
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Mon Dec 14 08:39:39 2015 +0000

    tracker: ensure ID is always obtained
    
    GRL_METADATA_KEY_ID is almost a mandatory key, and thus must be obtained
    even if user doesn't request it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758654

 src/tracker/grl-tracker-source-api.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker/grl-tracker-source-api.c b/src/tracker/grl-tracker-source-api.c
index d3ba707..175e8f8 100644
--- a/src/tracker/grl-tracker-source-api.c
+++ b/src/tracker/grl-tracker-source-api.c
@@ -1268,6 +1268,10 @@ void
 grl_tracker_source_browse (GrlSource *source,
                            GrlSourceBrowseSpec *bs)
 {
+  /* Ensure GRL_METADATA_KEY_ID is always requested */
+  if (!g_list_find (bs->keys, GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ID)))
+    bs->keys = g_list_prepend (bs->keys, GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ID));
+
   if (grl_tracker_browse_filesystem)
     grl_tracker_source_browse_filesystem (source, bs);
   else
@@ -1425,6 +1429,10 @@ grl_tracker_source_get_media_from_uri (GrlSource *source,
 
   GRL_IDEBUG ("%s: id=%u", __FUNCTION__, mfus->operation_id);
 
+  /* Ensure GRL_METADATA_KEY_ID is always requested */
+  if (!g_list_find (mfus->keys, GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ID)))
+    mfus->keys = g_list_prepend (mfus->keys, GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ID));
+
   constraint = grl_tracker_source_get_device_constraint (priv);
   sparql_select = grl_tracker_source_get_select_string (mfus->keys);
   sparql_final = g_strdup_printf (TRACKER_MEDIA_FROM_URI_REQUEST,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]