[gnome-photos/wip/rishi/fix-tracker-assertions: 2/3] item-manager: Avoid CRITICALs when adding an item to a mode




commit 727e5adb96ab74a2d81d051cbf0d4e2593391167
Author: Sam Thursfield <sam afuera me uk>
Date:   Thu Sep 10 19:02:32 2020 +0200

    item-manager: Avoid CRITICALs when adding an item to a mode
    
    The mtime is stored as nfo:fileLastModified or nie:contentLastModified
    in the Tracker database. These properties are of type xsd:dateTime,
    and are returned as strings, not booleans. Hence it led to:
      Tracker-CRITICAL **: tracker_sparql_cursor_real_get_boolean:
        assertion '_tmp0_ == TRACKER_SPARQL_VALUE_TYPE_BOOLEAN' failed
    
    These CRITICALs were more often (always?) triggered when using
    TrackerSparqlConnection's "bus" backend that uses D-Bus to access the
    Tracker database. eg., the Flatpak builds that don't bundle the Tracker
    D-Bus services.
    
    Fallout from 3ad413e3dc7b5375efebf4e32bce6c66be24d6a5
    
    https://gitlab.gnome.org/GNOME/gnome-photos/-/merge_requests/149

 src/photos-item-manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index c44fbbfc..337891c1 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -181,7 +181,7 @@ photos_item_manager_can_add_cursor_for_mode (PhotosItemManager *self,
   gboolean ret_val = TRUE;
   gint64 mtime;
 
-  mtime = tracker_sparql_cursor_get_boolean (cursor, PHOTOS_QUERY_COLUMNS_MTIME);
+  mtime = photos_utils_get_mtime_from_sparql_cursor (cursor);
   ret_val = photos_item_manager_can_add_mtime_for_mode (self, mtime, mode);
   return ret_val;
 }


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