Commit 783d8169 authored by Alexandru Pandelea's avatar Alexandru Pandelea

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
parent 73ac9eeb
......@@ -1056,13 +1056,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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment