[tracker-miners/wip/carlosg/speed-track: 1/3] libtracker-miner: Add explicit arg to force creation of bnode label
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/speed-track: 1/3] libtracker-miner: Add explicit arg to force creation of bnode label
- Date: Fri, 23 Oct 2020 10:47:35 +0000 (UTC)
commit 915fd779d95acd8f265fbec8cd1dca7b22d64437
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Oct 23 12:23:17 2020 +0200
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.
src/libtracker-miner/tracker-miner-fs.c | 6 ++++--
src/libtracker-miner/tracker-miner-fs.h | 3 ++-
src/miners/fs/tracker-miner-files.c | 11 ++++++-----
3 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index bd24d53b3..4567a9bce 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -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;
diff --git a/src/libtracker-miner/tracker-miner-fs.h b/src/libtracker-miner/tracker-miner-fs.h
index b53a00c17..6694ea385 100644
--- a/src/libtracker-miner/tracker-miner-fs.h
+++ b/src/libtracker-miner/tracker-miner-fs.h
@@ -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);
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 8275dfa42..738b78ab4 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -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 =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]