[tracker/wip/extract-graphs: 23/30] tracker-extract, libxine: Do all inserts in miner-fs's graph



commit 6643b4ff3911f4088613c6f24a13e2df71c62673
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Sep 6 10:40:39 2011 +0200

    tracker-extract, libxine: Do all inserts in miner-fs's graph

 src/tracker-extract/tracker-extract-libxine.c |   50 +++++++++++++++----------
 1 files changed, 30 insertions(+), 20 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-libxine.c b/src/tracker-extract/tracker-extract-libxine.c
index 3551d8e..2be16be 100644
--- a/src/tracker-extract/tracker-extract-libxine.c
+++ b/src/tracker-extract/tracker-extract-libxine.c
@@ -31,33 +31,31 @@
 G_MODULE_EXPORT gboolean
 tracker_extract_get_metadata (TrackerExtractInfo *info)
 {
-	xine_t            *xine_base;
+	xine_t *xine_base;
 	xine_audio_port_t *audio_port;
 	xine_video_port_t *video_port;
-	xine_stream_t     *stream;
-	char              *mrl;
-
-	gboolean          has_audio;
-	gboolean          has_video;
-
-	int               pos_stream;
-	int               pos_time;
-	int               length_time;
-
-	const char        *comment;
-	const char        *title;
-	const char        *author;
-	const char        *album;
-	gchar             *year;
-	const char        *genre;
-	const char        *track;
-
+	xine_stream_t *stream;
+	char *mrl;
+	gboolean has_audio;
+	gboolean has_video;
+	int pos_stream;
+	int pos_time;
+	int length_time;
+	const char *comment;
+	const char *title;
+	const char *author;
+	const char *album;
+	gchar *year;
+	const char *genre;
+	const char *track;
+	const gchar *graph;
 	TrackerSparqlBuilder *metadata, *preupdate;
-	GFile             *file;
+	GFile  *file;
 
 	file = tracker_extract_info_get_file (info);
 	metadata = tracker_extract_info_get_metadata_builder (info);
 	preupdate = tracker_extract_info_get_preupdate_builder (info);
+	graph = tracker_extract_info_get_graph (info);
 
 	xine_base = xine_new ();
 
@@ -105,11 +103,17 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 		gchar *canonical_uri = tracker_sparql_escape_uri_printf ("urn:artist:%s", author);
 
 		tracker_sparql_builder_insert_open (preupdate, NULL);
+		if (graph) {
+			tracker_sparql_builder_graph_open (preupdate, graph);
+		}
 
 		tracker_sparql_builder_subject_iri (preupdate, canonical_uri);
 		tracker_sparql_builder_predicate (preupdate, "a");
 		tracker_sparql_builder_object (preupdate, "nmm:Artist");
 
+		if (graph) {
+			tracker_sparql_builder_graph_close (preupdate);
+		}
 		tracker_sparql_builder_insert_close (preupdate);
 
 		g_free (canonical_uri);
@@ -120,6 +124,9 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 		gchar *canonical_uri = tracker_sparql_escape_uri_printf ("urn:album:%s", album);
 
 		tracker_sparql_builder_insert_open (preupdate, NULL);
+		if (graph) {
+			tracker_sparql_builder_graph_open (preupdate, graph);
+		}
 
 		tracker_sparql_builder_subject_iri (preupdate, canonical_uri);
 		tracker_sparql_builder_predicate (preupdate, "a");
@@ -130,6 +137,9 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 		tracker_sparql_builder_predicate (preupdate, "nmm:albumTitle");
 		tracker_sparql_builder_object_unvalidated (preupdate, album);
 
+		if (graph) {
+			tracker_sparql_builder_graph_close (preupdate);
+		}
 		tracker_sparql_builder_insert_close (preupdate);
 
 		g_free (canonical_uri);



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