[nautilus/gnome-3-22] batch-rename-utilities: check if file has nie:url



commit dafc104a3d19a10d65d3498784778cdcaad66c64
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date:   Mon Jan 2 22:45:41 2017 +0200

    batch-rename-utilities: check if file has nie:url
    
    If there is a file indexed by tracker that doesn't have nie:url, then
    the query will fail everytime, because it will pass null to
    uri-is-parent which will then give an error.
    
    To fix this, in the query, check first that the file has nie:url.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770944

 src/nautilus-batch-rename-utilities.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-batch-rename-utilities.c b/src/nautilus-batch-rename-utilities.c
index d87884d..52c3de9 100644
--- a/src/nautilus-batch-rename-utilities.c
+++ b/src/nautilus-batch-rename-utilities.c
@@ -1042,13 +1042,13 @@ check_metadata_for_selection (NautilusBatchRenameDialog *dialog,
                           "nmm:artistName(nmm:performer(?file)) "
                           "nie:title(?file) "
                           "nmm:albumTitle(nmm:musicAlbum(?file)) "
-                          "WHERE { ?file a nfo:FileDataObject. ");
+                          "WHERE { ?file a nfo:FileDataObject. ?file nie:url ?url. ");
 
     parent_uri = nautilus_file_get_parent_uri (NAUTILUS_FILE (selection->data));
     parent_uri_escaped = g_markup_escape_text (parent_uri, -1);
 
     g_string_append_printf (query,
-                            "FILTER(tracker:uri-is-parent('%s', nie:url(?file))) ",
+                            "FILTER(tracker:uri-is-parent('%s', ?url)) ",
                             parent_uri_escaped);
 
     for (l = selection; l != NULL; l = l->next)


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