Commit 915fd779 authored by Carlos Garnacho's avatar Carlos Garnacho

libtracker-miner: Add explicit arg to force creation of bnode label

This way we don't rely on miner fs internals deeming a folder as
"being processed" while we are creating its metadata.
parent d8185367
......@@ -2543,12 +2543,14 @@ tracker_miner_fs_get_data_provider (TrackerMinerFS *fs)
gchar *
tracker_miner_fs_get_file_bnode (TrackerMinerFS *fs,
GFile *file)
GFile *file,
gboolean create)
{
g_return_val_if_fail (TRACKER_IS_MINER_FS (fs), NULL);
g_return_val_if_fail (G_IS_FILE (file), NULL);
if (tracker_task_pool_find (fs->priv->task_pool, file) ||
if (create ||
tracker_task_pool_find (fs->priv->task_pool, file) ||
tracker_sparql_buffer_get_state (fs->priv->sparql_buffer, file) == TRACKER_BUFFER_STATE_QUEUED) {
gchar *uri, *bnode, *checksum;
......
......@@ -162,7 +162,8 @@ void tracker_miner_fs_notify_finish (TrackerMinerFS *f
const gchar *tracker_miner_fs_get_folder_urn (TrackerMinerFS *fs,
GFile *file);
gchar * tracker_miner_fs_get_file_bnode (TrackerMinerFS *fs,
GFile *file);
GFile *file,
gboolean create);
/* Progress */
gboolean tracker_miner_fs_has_items_to_process (TrackerMinerFS *fs);
......
......@@ -1966,6 +1966,7 @@ index_applications_changed_cb (GObject *gobject,
static gchar *
folder_urn_or_bnode (TrackerMinerFiles *mf,
GFile *file,
gboolean new_bnode,
gboolean *is_iri)
{
const gchar *urn;
......@@ -1980,7 +1981,7 @@ folder_urn_or_bnode (TrackerMinerFiles *mf,
return g_strdup (urn);
}
return tracker_miner_fs_get_file_bnode (TRACKER_MINER_FS (mf), file);
return tracker_miner_fs_get_file_bnode (TRACKER_MINER_FS (mf), file, new_bnode);
}
static void
......@@ -2002,7 +2003,7 @@ miner_files_add_to_datasource (TrackerMinerFiles *mf,
root = tracker_indexing_tree_get_root (indexing_tree, file, NULL);
if (root)
identifier = folder_urn_or_bnode (mf, root, NULL);
identifier = folder_urn_or_bnode (mf, root, FALSE, NULL);
if (identifier)
tracker_resource_set_uri (resource, "nie:dataSource", identifier);
......@@ -2042,7 +2043,7 @@ miner_files_create_folder_information_element (TrackerMinerFiles *miner,
gchar *urn, *uri;
/* Preserve URN for nfo:Folders */
urn = folder_urn_or_bnode (miner, file, NULL);
urn = folder_urn_or_bnode (miner, file, TRUE, NULL);
resource = tracker_resource_new (urn);
g_free (urn);
......@@ -2168,7 +2169,7 @@ process_file_cb (GObject *object,
tracker_resource_add_uri (resource, "rdf:type", "nfo:FileDataObject");
parent = g_file_get_parent (file);
parent_urn = folder_urn_or_bnode (data->miner, parent, NULL);
parent_urn = folder_urn_or_bnode (data->miner, parent, FALSE, NULL);
g_object_unref (parent);
if (parent_urn) {
......@@ -2475,7 +2476,7 @@ miner_files_move_file (TrackerMinerFS *fs,
gboolean is_iri;
new_parent_id = folder_urn_or_bnode (TRACKER_MINER_FILES (fs),
new_parent, &is_iri);
new_parent, FALSE, &is_iri);
if (new_parent_id) {
container_clause =
......
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