[tracker/tracker-0.8] tracker-extract-gstreamer: Set nmm:albumArtist to nmm:MusicAlbum



commit 56966c92a180b5f3359031809ba8937a631767df
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu May 13 11:37:40 2010 +0200

    tracker-extract-gstreamer: Set nmm:albumArtist to nmm:MusicAlbum

 src/tracker-extract/tracker-extract-gstreamer.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index d4b364a..a785d5b 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -498,6 +498,7 @@ extract_metadata (MetadataExtractor      *extractor,
 	g_return_if_fail (metadata != NULL);
 
 	if (extractor->tagcache) {
+		gchar *artist_uri = NULL;
 		gchar *performer_uri = NULL;
 		gchar *composer_uri = NULL;
 		gchar *album_uri = NULL;
@@ -526,6 +527,18 @@ extract_metadata (MetadataExtractor      *extractor,
 			gst_tag_list_get_string (extractor->tagcache, GST_TAG_PERFORMER, &performer);
 			gst_tag_list_get_string (extractor->tagcache, GST_TAG_ARTIST, &artist_local);
 
+			if (artist_local) {
+				artist_uri = tracker_uri_printf_escaped ("urn:artist:%s", artist_local);
+
+				tracker_sparql_builder_insert_open (preupdate, NULL);
+				tracker_sparql_builder_subject_iri (preupdate, artist_uri);
+				tracker_sparql_builder_predicate (preupdate, "a");
+				tracker_sparql_builder_object (preupdate, "nmm:Artist");
+				tracker_sparql_builder_predicate (preupdate, "nmm:artistName");
+				tracker_sparql_builder_object_unvalidated (preupdate, artist_local);
+				tracker_sparql_builder_insert_close (preupdate);
+			}
+
 			s = tracker_coalesce (2, performer, artist_local);
 
 			if (s) {
@@ -584,6 +597,11 @@ extract_metadata (MetadataExtractor      *extractor,
 			tracker_sparql_builder_predicate (preupdate, "nmm:albumTitle");
 			tracker_sparql_builder_object_unvalidated (preupdate, s);
 
+			if (artist_uri) {
+				tracker_sparql_builder_predicate (preupdate, "nmm:albumArtist");
+				tracker_sparql_builder_object_iri (preupdate, artist_uri);
+			}
+
 			tracker_sparql_builder_insert_close (preupdate);
 
 			has_it = gst_tag_list_get_uint (extractor->tagcache,
@@ -775,6 +793,7 @@ extract_metadata (MetadataExtractor      *extractor,
 		}
 
 		g_free (performer_uri);
+		g_free (artist_uri);
 		g_free (composer_uri);
 		g_free (album_uri);
 



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