[gnome-documents/wip/skydrive: 6/9] miner: Insert Skydrive created_time as nie:contentCreated



commit 71b96b2cc0d302128ea9d54cf0ccdc34fbc13990
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu May 24 14:55:11 2012 +0200

    miner: Insert Skydrive created_time as nie:contentCreated
    
    Fixes: https://bugzilla.gnome.org/666535

 src/miner/gd-zpj-miner.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/miner/gd-zpj-miner.c b/src/miner/gd-zpj-miner.c
index e240f36..bfb9027 100644
--- a/src/miner/gd-zpj-miner.c
+++ b/src/miner/gd-zpj-miner.c
@@ -159,7 +159,7 @@ account_miner_job_process_entry (AccountMinerJob *job,
                                  ZpjSkydriveEntry *entry,
                                  GError **error)
 {
-  GDateTime *updated_time;
+  GDateTime *created_time, *updated_time;
   gchar *resource = NULL;
   gchar *date, *datasource_urn, *identifier;
   const gchar *class = NULL, *id;
@@ -203,6 +203,18 @@ account_miner_job_process_entry (AccountMinerJob *job,
   if (*error != NULL)
     goto out;
 
+  created_time = zpj_skydrive_entry_get_created_time (entry);
+  date = gd_iso8601_from_timestamp (g_date_time_to_unix (created_time));
+  gd_miner_tracker_sparql_connection_insert_or_replace_triple
+    (job->connection,
+     job->cancellable, error,
+     identifier, resource,
+     "nie:contentCreated", date);
+  g_free (date);
+
+  if (*error != NULL)
+    goto out;
+
   updated_time = zpj_skydrive_entry_get_updated_time (entry);
   date = gd_iso8601_from_timestamp (g_date_time_to_unix (updated_time));
   gd_miner_tracker_sparql_connection_insert_or_replace_triple



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