[tracker] tracker-extract: gupnp-dlna: Ensure that a Disc1 MusicAlbumDisc exists
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-extract: gupnp-dlna: Ensure that a Disc1 MusicAlbumDisc exists
- Date: Thu, 9 Dec 2010 11:04:13 +0000 (UTC)
commit 8b4dafb8c931b522564e4dd92a795d338a853e16
Author: Philip Van Hoof <philip codeminded be>
Date: Tue Dec 7 16:00:53 2010 +0100
tracker-extract: gupnp-dlna: Ensure that a Disc1 MusicAlbumDisc exists
src/tracker-extract/tracker-extract-gupnp-dlna.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gupnp-dlna.c b/src/tracker-extract/tracker-extract-gupnp-dlna.c
index e9102be..108e91b 100644
--- a/src/tracker-extract/tracker-extract-gupnp-dlna.c
+++ b/src/tracker-extract/tracker-extract-gupnp-dlna.c
@@ -481,13 +481,14 @@ extract_metadata (MetadataExtractor *extractor,
tracker_sparql_builder_insert_close (preupdate);
}
- has_it = gst_tag_list_get_uint (extractor->tags,
- GST_TAG_ALBUM_VOLUME_NUMBER,
- &count);
+ if (albumname) {
+ has_it = gst_tag_list_get_uint (extractor->tags,
+ GST_TAG_ALBUM_VOLUME_NUMBER,
+ &count);
- if (has_it) {
album_disc_uri = tracker_sparql_escape_uri_printf ("urn:album-disc:%s/%d",
- albumname, count);
+ albumname,
+ has_it ? count : 1);
tracker_sparql_builder_insert_open (preupdate, NULL);
tracker_sparql_builder_subject_iri (preupdate, album_disc_uri);
@@ -509,7 +510,7 @@ extract_metadata (MetadataExtractor *extractor,
tracker_sparql_builder_insert_open (preupdate, NULL);
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_object_int64 (preupdate, has_it ? count : 1);
tracker_sparql_builder_insert_close (preupdate);
tracker_sparql_builder_delete_open (preupdate, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]