[PATCH 06/14] tracker: fix bitrate/width/height properties handling



From: Lionel Landwerlin <lionel g landwerlin linux intel com>

Signed-off-by: Lionel Landwerlin <lionel g landwerlin linux intel com>
---
 src/tracker/grl-tracker.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/tracker/grl-tracker.c b/src/tracker/grl-tracker.c
index d997446..c028f20 100644
--- a/src/tracker/grl-tracker.c
+++ b/src/tracker/grl-tracker.c
@@ -306,7 +306,7 @@ setup_key_mappings (void)
                       "audio");
 
   insert_key_mapping (GRL_METADATA_KEY_BITRATE,
-                      MEDIA_PROP_NONE,
+                      MEDIA_PROP_INT,
                       "nfo:averageBitrate(?urn)",
                       "audio");
 
@@ -331,7 +331,7 @@ setup_key_mappings (void)
                       "video");
 
   insert_key_mapping (GRL_METADATA_KEY_HEIGHT,
-                      MEDIA_PROP_NONE,
+                      MEDIA_PROP_INT,
                       "nfo:height(?urn)",
                       "video");
 
@@ -370,7 +370,7 @@ setup_key_mappings (void)
                       "file");
 
   insert_key_mapping (GRL_METADATA_KEY_WIDTH,
-                      MEDIA_PROP_NONE,
+                      MEDIA_PROP_INT,
                       "nfo:width(?urn)",
                       "video");
 }
@@ -473,8 +473,14 @@ fill_grilo_media_from_sparql (GrlMedia *media,
              assoc->grl_key_type,
              tracker_sparql_cursor_get_string (cursor, column, NULL));
 
+  if (tracker_sparql_cursor_is_bound (cursor, column) == FALSE) {
+    GRL_DEBUG ("\t\tDropping, no data");
+    return;
+  }
+
   if (grl_data_has_key (GRL_DATA (media), assoc->grl_key)) {
     GRL_DEBUG ("\t\tDropping, already here");
+    return;
   }
 
   switch (assoc->grl_key_type) {
-- 
1.7.2.3



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