[tracker/cuesheets-0.12] tracker-extract-gstreamer: Return more metadata in 1 file==1 track cases
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/cuesheets-0.12] tracker-extract-gstreamer: Return more metadata in 1 file==1 track cases
- Date: Fri, 23 Sep 2011 11:35:25 +0000 (UTC)
commit 758e1fc38f9b051abe48f320cc304cd93ebd04d1
Author: Sam Thursfield <sam thursfield codethink co uk>
Date: Fri Sep 23 11:52:26 2011 +0100
tracker-extract-gstreamer: Return more metadata in 1 file==1 track cases
src/tracker-extract/tracker-cue-sheet.c | 16 ++++++++++++++++
src/tracker-extract/tracker-extract-gstreamer.c | 18 +++++++++++++++++-
2 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-extract/tracker-cue-sheet.c b/src/tracker-extract/tracker-cue-sheet.c
index efd92d7..7411bea 100644
--- a/src/tracker-extract/tracker-cue-sheet.c
+++ b/src/tracker-extract/tracker-cue-sheet.c
@@ -170,6 +170,8 @@ process_toc_tags (TrackerToc *toc)
gint track_count;
gint i;
+ gchar *album_artist = NULL;
+
if (gst_tag_list_get_tag_size (toc->tag_list, GST_TAG_TRACK_COUNT) == 0) {
track_count = g_list_length (toc->entry_list);
gst_tag_list_add (toc->tag_list,
@@ -179,6 +181,8 @@ process_toc_tags (TrackerToc *toc)
NULL);
}
+ gst_tag_list_get_string (toc->tag_list, GST_TAG_ALBUM_ARTIST, &album_artist);
+
i = 1;
for (node=toc->entry_list; node; node=node->next, i++) {
TrackerTocEntry *entry = node->data;
@@ -189,7 +193,19 @@ process_toc_tags (TrackerToc *toc)
GST_TAG_TRACK_NUMBER,
i,
NULL);
+
+ if (album_artist != NULL) {
+ if (gst_tag_list_get_tag_size (toc->tag_list, GST_TAG_ARTIST) == 0 &&
+ gst_tag_list_get_tag_size (toc->tag_list, GST_TAG_PERFORMER) == 0)
+ gst_tag_list_add (entry->tag_list,
+ GST_TAG_MERGE_REPLACE,
+ GST_TAG_ARTIST,
+ album_artist,
+ NULL);
+ }
}
+
+ g_free (album_artist);
}
/* This function runs in two modes: for external CUE sheets, it will check
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 983ce72..9670bad 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -906,11 +906,27 @@ extract_metadata (MetadataExtractor *extractor,
g_return_if_fail (postupdate != NULL);
g_return_if_fail (metadata != NULL);
- if (extractor->toc)
+ if (extractor->toc) {
gst_tag_list_insert (extractor->tagcache,
extractor->toc->tag_list,
GST_TAG_MERGE_REPLACE);
+ if (g_list_length (extractor->toc->entry_list) == 1) {
+ /* If we only got one track, stick all the info together and
+ * forget about the table of contents
+ */
+ TrackerTocEntry *toc_entry;
+
+ toc_entry = extractor->toc->entry_list->data;
+ gst_tag_list_insert (extractor->tagcache,
+ toc_entry->tag_list,
+ GST_TAG_MERGE_REPLACE);
+
+ tracker_toc_free (extractor->toc);
+ extractor->toc = NULL;
+ }
+ }
+
if (extractor->mime == EXTRACT_MIME_GUESS && extractor->tagcache)
extractor_guess_content_type (extractor);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]