[tracker/multidisc-album: 11/11] tracker-extract: Make multi-disc albums work in GuPNG-DLNA extractor
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/multidisc-album: 11/11] tracker-extract: Make multi-disc albums work in GuPNG-DLNA extractor
- Date: Fri, 3 Dec 2010 15:13:33 +0000 (UTC)
commit b4b73d6d88012f10863e4376a302f38c2dd7f987
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Dec 3 16:11:18 2010 +0100
tracker-extract: Make multi-disc albums work in GuPNG-DLNA extractor
src/tracker-extract/tracker-extract-gupnp-dlna.c | 39 +++++++++++++++++++---
1 files changed, 34 insertions(+), 5 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gupnp-dlna.c b/src/tracker-extract/tracker-extract-gupnp-dlna.c
index 61c14a3..030cda4 100644
--- a/src/tracker-extract/tracker-extract-gupnp-dlna.c
+++ b/src/tracker-extract/tracker-extract-gupnp-dlna.c
@@ -365,6 +365,7 @@ extract_metadata (MetadataExtractor *extractor,
gchar *performer_uri = NULL;
gchar *composer_uri = NULL;
gchar *album_uri = NULL;
+ gchar *album_disc_uri = NULL;
/* General */
if (extractor->content == CONTENT_AUDIO || extractor->content == CONTENT_VIDEO) {
@@ -485,24 +486,47 @@ extract_metadata (MetadataExtractor *extractor,
&count);
if (has_it) {
+ album_disc_uri = tracker_sparql_escape_uri_printf ("urn:album-disc:%s/%d",
+ albumname, count);
+
+ tracker_sparql_builder_insert_open (preupdate, NULL);
+ tracker_sparql_builder_subject_iri (preupdate, album_disc_uri);
+ tracker_sparql_builder_predicate (preupdate, "a");
+ tracker_sparql_builder_object (preupdate, "nmm:MusicAlbumDisc");
+ tracker_sparql_builder_insert_close (preupdate);
+
tracker_sparql_builder_delete_open (preupdate, NULL);
- tracker_sparql_builder_subject_iri (preupdate, album_uri);
+ tracker_sparql_builder_subject_iri (preupdate, album_disc_uri);
tracker_sparql_builder_predicate (preupdate, "nmm:setNumber");
tracker_sparql_builder_object_variable (preupdate, "unknown");
tracker_sparql_builder_delete_close (preupdate);
-
tracker_sparql_builder_where_open (preupdate);
- tracker_sparql_builder_subject_iri (preupdate, album_uri);
+ tracker_sparql_builder_subject_iri (preupdate, album_disc_uri);
tracker_sparql_builder_predicate (preupdate, "nmm:setNumber");
tracker_sparql_builder_object_variable (preupdate, "unknown");
tracker_sparql_builder_where_close (preupdate);
tracker_sparql_builder_insert_open (preupdate, NULL);
-
- tracker_sparql_builder_subject_iri (preupdate, album_uri);
+ tracker_sparql_builder_subject_iri (preupdate, album_disc_uri);
tracker_sparql_builder_predicate (preupdate, "nmm:setNumber");
tracker_sparql_builder_object_int64 (preupdate, count);
+ tracker_sparql_builder_insert_close (preupdate);
+ tracker_sparql_builder_delete_open (preupdate, NULL);
+ tracker_sparql_builder_subject_iri (preupdate, album_disc_uri);
+ tracker_sparql_builder_predicate (preupdate, "nmm:albumDiscAlbum");
+ tracker_sparql_builder_object_variable (preupdate, "unknown");
+ tracker_sparql_builder_delete_close (preupdate);
+ tracker_sparql_builder_where_open (preupdate);
+ tracker_sparql_builder_subject_iri (preupdate, album_disc_uri);
+ tracker_sparql_builder_predicate (preupdate, "nmm:albumDiscAlbum");
+ tracker_sparql_builder_object_variable (preupdate, "unknown");
+ tracker_sparql_builder_where_close (preupdate);
+
+ tracker_sparql_builder_insert_open (preupdate, NULL);
+ tracker_sparql_builder_subject_iri (preupdate, album_disc_uri);
+ tracker_sparql_builder_predicate (preupdate, "nmm:albumDiscAlbum");
+ tracker_sparql_builder_object_iri (preupdate, album_uri);
tracker_sparql_builder_insert_close (preupdate);
}
@@ -675,6 +699,11 @@ extract_metadata (MetadataExtractor *extractor,
tracker_sparql_builder_predicate (metadata, "nmm:musicAlbum");
tracker_sparql_builder_object_iri (metadata, album_uri);
}
+
+ if (album_disc_uri) {
+ tracker_sparql_builder_predicate (metadata, "nmm:musicAlbumDisk");
+ tracker_sparql_builder_object_iri (metadata, album_disc_uri);
+ }
}
g_free (artist_uri);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]