[gnome-online-miners/wip/rishi/onedrive] zpj: Use an HTTP URL as nie:url



commit 6ce14d899167c7902b6d02e3e1bb8f83ca6331fd
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 27 18:36:30 2017 +0200

    zpj: Use an HTTP URL as nie:url
    
    The nao:identifier value is not a valid nie:url. The identifier has the
    format "windows-live:skydrive:<id>", and is not a GVfs supported URI.
    This is a problem because the nie:url is used to locate the path to
    the entry's thumbnail in the desktop's thumbnail cache. Running
    g_file_query_info (file, G_FILE_ATTRIBUTE_THUMBNAIL_PATH, ...) on such
    a URI will fail. Therefore we use a fake OneDrive-namespaced URI that
    GVfs understands.
    
    Force a full reindex of OneDrive resources for existing users.

 src/gom-zpj-miner.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gom-zpj-miner.c b/src/gom-zpj-miner.c
index 6dff947..da54c2a 100644
--- a/src/gom-zpj-miner.c
+++ b/src/gom-zpj-miner.c
@@ -46,6 +46,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
   gchar *contact_resource;
   gchar *resource = NULL;
   gchar *date, *identifier;
+  gchar *url = NULL;
   const gchar *class = NULL, *id, *name;
   gboolean resource_exists, mtime_changed;
   gint64 new_mtime;
@@ -99,11 +100,12 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
     goto out;
 
   /* the resource changed - just set all the properties again */
+  url = g_strconcat ("http://onedrive.com/";, id, NULL);
   gom_tracker_sparql_connection_insert_or_replace_triple
     (connection,
      cancellable, error,
      datasource_urn, resource,
-     "nie:url", identifier);
+     "nie:url", url);
 
   if (*error != NULL)
     goto out;
@@ -202,6 +204,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
  out:
   g_free (resource);
   g_free (identifier);
+  g_free (url);
 
   if (*error != NULL)
     return FALSE;
@@ -324,7 +327,7 @@ gom_zpj_miner_class_init (GomZpjMinerClass *klass)
 
   miner_class->goa_provider_type = "windows_live";
   miner_class->miner_identifier = MINER_IDENTIFIER;
-  miner_class->version = 1;
+  miner_class->version = 2;
 
   miner_class->create_services = create_services;
   miner_class->query = query_zpj;


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