[gnome-online-miners/wip/rishi/insert-share: 15/24] src: Pass 'datasource_urn' separately to the query vfunc
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-miners/wip/rishi/insert-share: 15/24] src: Pass 'datasource_urn' separately to the query vfunc
- Date: Mon, 5 Sep 2016 15:04:09 +0000 (UTC)
commit bbb1da67fdb5cf69f5d58c9523e4577236a4e4ee
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Sep 5 14:26:17 2016 +0200
src: Pass 'datasource_urn' separately to the query vfunc
This will help us reuse the parts of the RefreshDB code for
implementing InsertSharedContent.
https://bugzilla.gnome.org/show_bug.cgi?id=770899
src/gom-facebook-miner.c | 47 +++++++++++-------
src/gom-flickr-miner.c | 35 ++++++++-----
src/gom-gdata-miner.c | 111 +++++++++++++++++++++++++++---------------
src/gom-media-server-miner.c | 20 +++++--
src/gom-miner.c | 2 +-
src/gom-miner.h | 1 +
src/gom-owncloud-miner.c | 29 ++++++++---
src/gom-zpj-miner.c | 30 ++++++-----
8 files changed, 176 insertions(+), 99 deletions(-)
---
diff --git a/src/gom-facebook-miner.c b/src/gom-facebook-miner.c
index b9700d3..ff42ca5 100644
--- a/src/gom-facebook-miner.c
+++ b/src/gom-facebook-miner.c
@@ -37,6 +37,7 @@ static gboolean
account_miner_job_process_photo (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GFBGraphPhoto *photo,
const gchar *parent_resource_urn,
const gchar *creator,
@@ -69,13 +70,13 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
(connection,
cancellable, error,
&resource_exists,
- job->datasource_urn, identifier,
+ datasource_urn, identifier,
"nfo:RemoteDataObject", class, NULL);
if (*error != NULL)
goto out;
- gom_tracker_update_datasource (connection, job->datasource_urn,
+ gom_tracker_update_datasource (connection, datasource_urn,
resource_exists, identifier, resource,
cancellable, error);
if (*error != NULL)
@@ -104,7 +105,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:url", photo_link);
if (*error != NULL)
@@ -113,7 +114,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:isPartOf", parent_resource_urn);
if (*error != NULL)
@@ -122,7 +123,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:mimeType", "image/jpeg");
if (*error != NULL)
@@ -131,7 +132,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:title", photo_name);
if (*error != NULL)
@@ -140,7 +141,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
contact_resource = gom_tracker_utils_ensure_contact_resource
(connection,
cancellable, error,
- job->datasource_urn, creator);
+ datasource_urn, creator);
if (*error != NULL)
goto out;
@@ -148,7 +149,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nco:creator", contact_resource);
g_free (contact_resource);
@@ -158,7 +159,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:contentCreated", photo_created_time);
if (*error != NULL)
@@ -181,6 +182,7 @@ static gboolean
account_miner_job_process_album (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GFBGraphAlbum *album,
const gchar *creator,
GCancellable *cancellable,
@@ -216,14 +218,14 @@ account_miner_job_process_album (GomAccountMinerJob *job,
(connection,
cancellable, error,
&resource_exists,
- job->datasource_urn, identifier,
+ datasource_urn, identifier,
"nfo:RemoteDataObject", class,
NULL);
if (*error != NULL)
goto out;
- gom_tracker_update_datasource (connection, job->datasource_urn,
+ gom_tracker_update_datasource (connection, datasource_urn,
resource_exists, identifier, resource,
cancellable, error);
@@ -237,7 +239,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:url", album_link);
if (*error != NULL)
@@ -246,7 +248,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:description", album_description);
if (*error != NULL)
@@ -255,7 +257,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:title", album_name);
if (*error != NULL)
@@ -264,7 +266,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
contact_resource = gom_tracker_utils_ensure_contact_resource
(connection,
cancellable, error,
- job->datasource_urn, creator);
+ datasource_urn, creator);
if (*error != NULL)
goto out;
@@ -272,7 +274,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nco:creator", contact_resource);
g_free (contact_resource);
@@ -282,7 +284,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:contentCreated", album_created_time);
if (*error != NULL)
@@ -304,6 +306,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
account_miner_job_process_photo (job,
connection,
previous_resources,
+ datasource_urn,
photo,
resource,
creator,
@@ -335,6 +338,7 @@ static void
query_facebook (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GCancellable *cancellable,
GError **error)
{
@@ -370,7 +374,14 @@ query_facebook (GomAccountMinerJob *job,
{
GFBGraphAlbum *album = GFBGRAPH_ALBUM (l->data);
- account_miner_job_process_album (job, connection, previous_resources, album, me_name, cancellable,
&local_error);
+ account_miner_job_process_album (job,
+ connection,
+ previous_resources,
+ datasource_urn,
+ album,
+ me_name,
+ cancellable,
+ &local_error);
if (local_error != NULL)
{
const gchar *album_id;
diff --git a/src/gom-flickr-miner.c b/src/gom-flickr-miner.c
index 232c7de..9ac338e 100644
--- a/src/gom-flickr-miner.c
+++ b/src/gom-flickr-miner.c
@@ -54,12 +54,14 @@ typedef struct {
GomAccountMinerJob *job;
GrlSource *source;
TrackerSparqlConnection *connection;
+ const gchar *datasource_urn;
const gchar *source_id;
} SyncData;
static void account_miner_job_browse_container (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
FlickrEntry *entry,
GCancellable *cancellable);
@@ -104,6 +106,7 @@ static gboolean
account_miner_job_process_entry (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
OpType op_type,
FlickrEntry *entry,
GCancellable *cancellable,
@@ -140,13 +143,13 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
(connection,
cancellable, error,
&resource_exists,
- job->datasource_urn, identifier,
+ datasource_urn, identifier,
"nfo:RemoteDataObject", class, NULL);
if (*error != NULL)
goto out;
- gom_tracker_update_datasource (connection, job->datasource_urn,
+ gom_tracker_update_datasource (connection, datasource_urn,
resource_exists, identifier, resource,
cancellable, error);
@@ -163,7 +166,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
(connection, cancellable, error,
NULL,
- job->datasource_urn, parent_identifier,
+ datasource_urn, parent_identifier,
"nfo:RemoteDataObject", "nfo:DataContainer", NULL);
g_free (parent_identifier);
@@ -173,7 +176,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:isPartOf", parent_resource_urn);
g_free (parent_resource_urn);
@@ -184,7 +187,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:title", grl_media_get_title (entry->media));
if (*error != NULL)
@@ -218,7 +221,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:contentCreated", date);
g_free (date);
}
@@ -230,7 +233,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:url", url);
if (*error != NULL)
@@ -239,7 +242,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:description", grl_media_get_description (entry->media));
if (*error != NULL)
@@ -251,7 +254,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:mimeType", mime);
g_free (mime);
@@ -262,7 +265,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
contact_resource = gom_tracker_utils_ensure_contact_resource
(connection,
cancellable, error,
- job->datasource_urn, grl_media_get_author (entry->media));
+ datasource_urn, grl_media_get_author (entry->media));
if (*error != NULL)
goto out;
@@ -270,7 +273,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nco:creator", contact_resource);
g_free (contact_resource);
@@ -313,6 +316,7 @@ source_browse_cb (GrlSource *source,
account_miner_job_process_entry (data->job,
data->connection,
data->previous_resources,
+ data->datasource_urn,
OP_CREATE_HIEARCHY,
entry,
data->cancellable,
@@ -337,6 +341,7 @@ static void
account_miner_job_browse_container (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
FlickrEntry *entry,
GCancellable *cancellable)
{
@@ -348,6 +353,7 @@ account_miner_job_browse_container (GomAccountMinerJob *job,
data.cancellable = cancellable;
data.connection = connection;
+ data.datasource_urn = datasource_urn;
data.parent_entry = entry;
data.job = job;
data.previous_resources = previous_resources;
@@ -400,6 +406,7 @@ source_search_cb (GrlSource *source,
account_miner_job_process_entry (data->job,
data->connection,
data->previous_resources,
+ data->datasource_urn,
OP_FETCH_ALL,
entry,
data->cancellable,
@@ -421,6 +428,7 @@ static void
query_flickr (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GCancellable *cancellable,
GError **error)
{
@@ -451,6 +459,7 @@ query_flickr (GomAccountMinerJob *job,
data.cancellable = cancellable;
data.connection = connection;
+ data.datasource_urn = datasource_urn;
data.job = job;
data.previous_resources = previous_resources;
context = g_main_context_new ();
@@ -468,13 +477,13 @@ query_flickr (GomAccountMinerJob *job,
g_main_context_unref (context);
entry = create_entry (NULL, NULL);
- account_miner_job_browse_container (job, connection, previous_resources, entry, cancellable);
+ account_miner_job_browse_container (job, connection, previous_resources, datasource_urn, entry,
cancellable);
free_entry (entry);
while (!g_queue_is_empty (priv->boxes))
{
entry = (FlickrEntry *) g_queue_pop_head (priv->boxes);
- account_miner_job_browse_container (job, connection, previous_resources, entry, cancellable);
+ account_miner_job_browse_container (job, connection, previous_resources, datasource_urn, entry,
cancellable);
free_entry (entry);
}
}
diff --git a/src/gom-gdata-miner.c b/src/gom-gdata-miner.c
index a0f80da..16f6577 100644
--- a/src/gom-gdata-miner.c
+++ b/src/gom-gdata-miner.c
@@ -58,6 +58,7 @@ static gboolean
account_miner_job_process_entry (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GDataDocumentsService *service,
GDataDocumentsEntry *doc_entry,
GCancellable *cancellable,
@@ -119,13 +120,13 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
(connection,
cancellable, error,
&resource_exists,
- job->datasource_urn, identifier,
+ datasource_urn, identifier,
"nfo:RemoteDataObject", class, NULL);
if (*error != NULL)
goto out;
- gom_tracker_update_datasource (connection, job->datasource_urn,
+ gom_tracker_update_datasource (connection, datasource_urn,
resource_exists, identifier, resource,
cancellable, error);
@@ -153,7 +154,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:url", alternate_uri);
if (*error != NULL)
@@ -168,7 +169,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:mimeType", mimetype_override);
if (*error != NULL)
@@ -186,7 +187,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
(connection, cancellable, error,
NULL,
- job->datasource_urn, parent_resource_id,
+ datasource_urn, parent_resource_id,
"nfo:RemoteDataObject", "nfo:DataContainer", NULL);
g_free (parent_resource_id);
@@ -196,7 +197,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:isPartOf", parent_resource_urn);
g_free (parent_resource_urn);
@@ -226,7 +227,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:description", gdata_entry_get_summary (entry));
if (*error != NULL)
@@ -235,7 +236,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:title", gdata_entry_get_title (entry));
if (*error != NULL)
@@ -259,7 +260,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nco:creator", contact_resource);
if (*error != NULL)
@@ -301,7 +302,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nco:contributor", contact_resource);
g_free (contact_resource);
@@ -314,7 +315,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:contentCreated", date);
g_free (date);
@@ -338,6 +339,7 @@ static gboolean
account_miner_job_process_photo (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GDataPicasaWebFile *photo,
const gchar *parent_resource_urn,
GCancellable *cancellable,
@@ -398,13 +400,13 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
(connection,
cancellable, error,
&resource_exists,
- job->datasource_urn, identifier,
+ datasource_urn, identifier,
"nfo:RemoteDataObject", "nmm:Photo", NULL);
if (*error != NULL)
goto out;
- gom_tracker_update_datasource (connection, job->datasource_urn,
+ gom_tracker_update_datasource (connection, datasource_urn,
resource_exists, identifier, resource,
cancellable, error);
if (*error != NULL)
@@ -433,7 +435,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:url", alternate_uri);
if (*error != NULL)
@@ -443,7 +445,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:description", summary);
if (*error != NULL)
@@ -452,7 +454,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:isPartOf", parent_resource_urn);
if (*error != NULL)
@@ -462,7 +464,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:mimeType", mime);
if (*error != NULL)
@@ -472,7 +474,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:title", title);
if (*error != NULL)
@@ -492,7 +494,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nco:creator", contact_resource);
g_free (contact_resource);
@@ -503,7 +505,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nmm:exposureTime", exposure);
g_free (exposure);
@@ -514,7 +516,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nmm:focalLength", focal_length);
g_free (focal_length);
@@ -525,7 +527,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nmm:fnumber", fstop);
g_free (fstop);
@@ -536,7 +538,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nmm:isoSpeed", iso);
g_free (iso);
@@ -547,7 +549,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nmm:flash", flash ? flash_on : flash_off);
if (*error != NULL)
@@ -570,7 +572,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nfo:equipment", equipment_resource);
if (*error != NULL)
@@ -581,7 +583,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nfo:width", width);
g_free (width);
@@ -592,7 +594,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nfo:height", height);
g_free (height);
@@ -604,7 +606,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:contentCreated", date);
g_free (date);
@@ -626,6 +628,7 @@ static gboolean
account_miner_job_process_album (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GDataPicasaWebService *service,
GDataPicasaWebAlbum *album,
GCancellable *cancellable,
@@ -660,7 +663,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
(connection,
cancellable, error,
&resource_exists,
- job->datasource_urn, identifier,
+ datasource_urn, identifier,
"nfo:RemoteDataObject", "nfo:DataContainer",
NULL);
@@ -668,7 +671,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
goto out;
gom_tracker_update_datasource
- (connection, job->datasource_urn,
+ (connection, datasource_urn,
resource_exists, identifier, resource,
cancellable, error);
@@ -698,7 +701,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:url", alternate_uri);
if (*error != NULL)
@@ -708,7 +711,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:description", summary);
if (*error != NULL)
@@ -718,7 +721,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:title", title);
if (*error != NULL)
@@ -738,7 +741,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nco:creator", contact_resource);
g_free (contact_resource);
@@ -750,7 +753,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:contentCreated", date);
g_free (date);
@@ -773,7 +776,14 @@ account_miner_job_process_album (GomAccountMinerJob *job,
{
GDataPicasaWebFile *file = GDATA_PICASAWEB_FILE (l->data);
- account_miner_job_process_photo (job, connection, previous_resources, file, resource, cancellable,
error);
+ account_miner_job_process_photo (job,
+ connection,
+ previous_resources,
+ datasource_urn,
+ file,
+ resource,
+ cancellable,
+ error);
if (*error != NULL)
{
@@ -800,6 +810,7 @@ static void
query_gdata_documents (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GDataDocumentsService *service,
GCancellable *cancellable,
GError **error)
@@ -847,6 +858,7 @@ query_gdata_documents (GomAccountMinerJob *job,
account_miner_job_process_entry (job,
connection,
previous_resources,
+ datasource_urn,
service,
l->data,
cancellable,
@@ -872,6 +884,7 @@ static void
query_gdata_photos (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GDataPicasaWebService *service,
GCancellable *cancellable,
GError **error)
@@ -889,7 +902,14 @@ query_gdata_photos (GomAccountMinerJob *job,
{
GDataPicasaWebAlbum *album = GDATA_PICASAWEB_ALBUM (l->data);
- account_miner_job_process_album (job, connection, previous_resources, service, album, cancellable,
error);
+ account_miner_job_process_album (job,
+ connection,
+ previous_resources,
+ datasource_urn,
+ service,
+ album,
+ cancellable,
+ error);
if (*error != NULL)
{
@@ -908,6 +928,7 @@ static void
query_gdata (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GCancellable *cancellable,
GError **error)
{
@@ -915,11 +936,23 @@ query_gdata (GomAccountMinerJob *job,
service = g_hash_table_lookup (job->services, "documents");
if (service != NULL)
- query_gdata_documents (job, connection, previous_resources, GDATA_DOCUMENTS_SERVICE (service),
cancellable, error);
+ query_gdata_documents (job,
+ connection,
+ previous_resources,
+ datasource_urn,
+ GDATA_DOCUMENTS_SERVICE (service),
+ cancellable,
+ error);
service = g_hash_table_lookup (job->services, "photos");
if (service != NULL)
- query_gdata_photos (job, connection, previous_resources, GDATA_PICASAWEB_SERVICE (service), cancellable,
error);
+ query_gdata_photos (job,
+ connection,
+ previous_resources,
+ datasource_urn,
+ GDATA_PICASAWEB_SERVICE (service),
+ cancellable,
+ error);
}
static GHashTable *
diff --git a/src/gom-media-server-miner.c b/src/gom-media-server-miner.c
index c0c6113..490869e 100644
--- a/src/gom-media-server-miner.c
+++ b/src/gom-media-server-miner.c
@@ -42,6 +42,7 @@ static gboolean
account_miner_job_process_photo (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GomDlnaPhotoItem *photo,
GCancellable *cancellable,
GError **error)
@@ -64,13 +65,13 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
(connection,
cancellable, error,
&resource_exists,
- job->datasource_urn, identifier,
+ datasource_urn, identifier,
"nfo:RemoteDataObject", class, NULL);
if (*error != NULL)
goto out;
- gom_tracker_update_datasource (connection, job->datasource_urn,
+ gom_tracker_update_datasource (connection, datasource_urn,
resource_exists, identifier, resource,
cancellable, error);
if (*error != NULL)
@@ -80,7 +81,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:url", photo->url);
if (*error != NULL)
@@ -89,7 +90,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:mimeType", photo->mimetype);
if (*error != NULL)
@@ -98,7 +99,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:title", photo->name);
if (*error != NULL)
@@ -120,6 +121,7 @@ static void
query_media_server (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GCancellable *cancellable,
GError **error)
{
@@ -155,7 +157,13 @@ query_media_server (GomAccountMinerJob *job,
{
GomDlnaPhotoItem *photo = (GomDlnaPhotoItem *) l->data;
- account_miner_job_process_photo (job, connection, previous_resources, photo, cancellable,
&local_error);
+ account_miner_job_process_photo (job,
+ connection,
+ previous_resources,
+ datasource_urn,
+ photo,
+ cancellable,
+ &local_error);
if (local_error != NULL)
{
g_warning ("Unable to process photo: %s", local_error->message);
diff --git a/src/gom-miner.c b/src/gom-miner.c
index 5f46ebf..7947f37 100644
--- a/src/gom-miner.c
+++ b/src/gom-miner.c
@@ -292,7 +292,7 @@ gom_account_miner_job_query (GomAccountMinerJob *job,
GCancellable *cancellable;
cancellable = g_task_get_cancellable (job->task);
- miner_class->query (job, job->connection, job->previous_resources, cancellable, error);
+ miner_class->query (job, job->connection, job->previous_resources, job->datasource_urn, cancellable,
error);
}
static void
diff --git a/src/gom-miner.h b/src/gom-miner.h
index 3d86c4a..a1b9349 100644
--- a/src/gom-miner.h
+++ b/src/gom-miner.h
@@ -93,6 +93,7 @@ struct _GomMinerClass
void (*query) (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GCancellable *cancellable,
GError **error);
};
diff --git a/src/gom-owncloud-miner.c b/src/gom-owncloud-miner.c
index fd0a252..34d303b 100644
--- a/src/gom-owncloud-miner.c
+++ b/src/gom-owncloud-miner.c
@@ -53,6 +53,7 @@ static gboolean
account_miner_job_process_file (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GFile *file,
GFileInfo *info,
GFile *parent,
@@ -99,13 +100,13 @@ account_miner_job_process_file (GomAccountMinerJob *job,
(connection,
cancellable, error,
&resource_exists,
- job->datasource_urn, identifier,
+ datasource_urn, identifier,
"nfo:RemoteDataObject", class, NULL);
if (*error != NULL)
goto out;
- gom_tracker_update_datasource (connection, job->datasource_urn,
+ gom_tracker_update_datasource (connection, datasource_urn,
resource_exists, identifier, resource,
cancellable, error);
@@ -132,7 +133,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:url", uri);
if (*error != NULL)
@@ -155,7 +156,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
(connection, cancellable, error,
NULL,
- job->datasource_urn, parent_identifier,
+ datasource_urn, parent_identifier,
"nfo:RemoteDataObject", "nfo:DataContainer", NULL);
g_checksum_reset (checksum);
g_free (parent_identifier);
@@ -167,7 +168,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:isPartOf", parent_resource_urn);
g_free (parent_resource_urn);
@@ -181,7 +182,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:mimeType", mime);
if (*error != NULL)
@@ -193,7 +194,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nfo:fileName", display_name);
if (*error != NULL)
@@ -216,6 +217,7 @@ static void
account_miner_job_traverse_dir (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GFile *dir,
gboolean is_root,
GCancellable *cancellable,
@@ -251,6 +253,7 @@ account_miner_job_traverse_dir (GomAccountMinerJob *job,
account_miner_job_process_file (job,
connection,
previous_resources,
+ datasource_urn,
child,
info,
is_root ? NULL : dir,
@@ -267,7 +270,14 @@ account_miner_job_traverse_dir (GomAccountMinerJob *job,
if (type == G_FILE_TYPE_DIRECTORY)
{
- account_miner_job_traverse_dir (job, connection, previous_resources, child, FALSE, cancellable,
&local_error);
+ account_miner_job_traverse_dir (job,
+ connection,
+ previous_resources,
+ datasource_urn,
+ child,
+ FALSE,
+ cancellable,
+ &local_error);
if (local_error != NULL)
{
uri = g_file_get_uri (child);
@@ -348,6 +358,7 @@ static void
query_owncloud (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GCancellable *cancellable,
GError **error)
{
@@ -425,7 +436,7 @@ query_owncloud (GomAccountMinerJob *job,
}
root = g_mount_get_root (mount);
- account_miner_job_traverse_dir (job, connection, previous_resources, root, TRUE, cancellable, error);
+ account_miner_job_traverse_dir (job, connection, previous_resources, datasource_urn, root, TRUE,
cancellable, error);
g_object_unref (root);
g_object_unref (mount);
diff --git a/src/gom-zpj-miner.c b/src/gom-zpj-miner.c
index 23868f7..6dff947 100644
--- a/src/gom-zpj-miner.c
+++ b/src/gom-zpj-miner.c
@@ -37,6 +37,7 @@ static gboolean
account_miner_job_process_entry (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
ZpjSkydriveEntry *entry,
GCancellable *cancellable,
GError **error)
@@ -69,13 +70,13 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
(connection,
cancellable, error,
&resource_exists,
- job->datasource_urn, identifier,
+ datasource_urn, identifier,
"nfo:RemoteDataObject", class, NULL);
if (*error != NULL)
goto out;
- gom_tracker_update_datasource (connection, job->datasource_urn,
+ gom_tracker_update_datasource (connection, datasource_urn,
resource_exists, identifier, resource,
cancellable, error);
@@ -101,7 +102,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:url", identifier);
if (*error != NULL)
@@ -118,7 +119,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
(connection, cancellable, error,
NULL,
- job->datasource_urn, parent_identifier,
+ datasource_urn, parent_identifier,
"nfo:RemoteDataObject", "nfo:DataContainer", NULL);
g_free (parent_identifier);
@@ -128,7 +129,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:isPartOf", parent_resource_urn);
g_free (parent_resource_urn);
@@ -141,7 +142,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:mimeType", mime);
g_free (mime);
@@ -153,7 +154,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:description", zpj_skydrive_entry_get_description (entry));
if (*error != NULL)
@@ -162,7 +163,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nfo:fileName", name);
if (*error != NULL)
@@ -171,7 +172,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
contact_resource = gom_tracker_utils_ensure_contact_resource
(connection,
cancellable, error,
- job->datasource_urn, zpj_skydrive_entry_get_from_name (entry));
+ datasource_urn, zpj_skydrive_entry_get_from_name (entry));
if (*error != NULL)
goto out;
@@ -179,7 +180,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nco:creator", contact_resource);
g_free (contact_resource);
@@ -191,7 +192,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
gom_tracker_sparql_connection_insert_or_replace_triple
(connection,
cancellable, error,
- job->datasource_urn, resource,
+ datasource_urn, resource,
"nie:contentCreated", date);
g_free (date);
@@ -212,6 +213,7 @@ static void
account_miner_job_traverse_folder (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
const gchar *folder_id,
GCancellable *cancellable,
GError **error)
@@ -247,14 +249,14 @@ account_miner_job_traverse_folder (GomAccountMinerJob *job,
if (ZPJ_IS_SKYDRIVE_FOLDER (entry))
{
- account_miner_job_traverse_folder (job, connection, previous_resources, id, cancellable, error);
+ account_miner_job_traverse_folder (job, connection, previous_resources, datasource_urn, id,
cancellable, error);
if (*error != NULL)
goto out;
}
else if (ZPJ_IS_SKYDRIVE_PHOTO (entry))
continue;
- account_miner_job_process_entry (job, connection, previous_resources, entry, cancellable, error);
+ account_miner_job_process_entry (job, connection, previous_resources, datasource_urn, entry,
cancellable, error);
if (*error != NULL)
{
@@ -272,12 +274,14 @@ static void
query_zpj (GomAccountMinerJob *job,
TrackerSparqlConnection *connection,
GHashTable *previous_resources,
+ const gchar *datasource_urn,
GCancellable *cancellable,
GError **error)
{
account_miner_job_traverse_folder (job,
connection,
previous_resources,
+ datasource_urn,
ZPJ_SKYDRIVE_FOLDER_SKYDRIVE,
cancellable,
error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]