[tracker/on-extractor-error: 3/4] miners/fs: Don't set IE properties in case of error
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/on-extractor-error: 3/4] miners/fs: Don't set IE properties in case of error
- Date: Tue, 3 May 2011 15:53:56 +0000 (UTC)
commit 86594ae006bab43ea25ad2b872d28fd7be69862a
Author: Philip Van Hoof <philip codeminded be>
Date: Tue May 3 17:30:36 2011 +0200
miners/fs: Don't set IE properties in case of error
src/miners/fs/tracker-miner-files.c | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index d465ee2..658c5a8 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -1957,6 +1957,8 @@ extractor_get_embedded_metadata_cb (const gchar *preupdate,
{
ProcessFileData *data = user_data;
const gchar *uuid;
+ gboolean is_iri;
+ const gchar *urn;
if (error) {
tracker_sparql_builder_graph_close (data->sparql);
@@ -1968,12 +1970,21 @@ extractor_get_embedded_metadata_cb (const gchar *preupdate,
return;
}
- if (sparql && *sparql) {
- gboolean is_iri;
- const gchar *urn;
+ urn = miner_files_get_file_urn (data->miner, data->file, &is_iri);
- urn = miner_files_get_file_urn (data->miner, data->file, &is_iri);
+ /* Laying the link between the IE and the DO. We use IE = DO, don't do this
+ * in case of error so that we can distinguish between succeeded and failed
+ * files with sparql queries */
+ tracker_sparql_builder_predicate (data->sparql, "a");
+ tracker_sparql_builder_object (data->sparql, "nie:InformationElement");
+ tracker_sparql_builder_predicate (data->sparql, "nie:isStoredAs");
+ if (is_iri) {
+ tracker_sparql_builder_object_iri (data->sparql, urn);
+ } else {
+ tracker_sparql_builder_object (data->sparql, urn);
+ }
+ if (sparql && *sparql) {
if (is_iri) {
gchar *str;
@@ -2429,7 +2440,6 @@ process_file_cb (GObject *object,
tracker_sparql_builder_predicate (sparql, "a");
tracker_sparql_builder_object (sparql, "nfo:FileDataObject");
- tracker_sparql_builder_object (sparql, "nie:InformationElement");
is_directory = (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY ?
TRUE : FALSE);
@@ -2458,14 +2468,6 @@ process_file_cb (GObject *object,
tracker_sparql_builder_predicate (sparql, "nfo:fileLastAccessed");
tracker_sparql_builder_object_date (sparql, (time_t *) &time_);
- /* Laying the link between the IE and the DO. We use IE = DO */
- tracker_sparql_builder_predicate (sparql, "nie:isStoredAs");
- if (is_iri) {
- tracker_sparql_builder_object_iri (sparql, urn);
- } else {
- tracker_sparql_builder_object (sparql, urn);
- }
-
/* The URL of the DataObject (because IE = DO, this is correct) */
tracker_sparql_builder_predicate (sparql, "nie:url");
tracker_sparql_builder_object_string (sparql, uri);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]