[tracker/cuesheets] tracker-extract: Fix cuesheet track numbers
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/cuesheets] tracker-extract: Fix cuesheet track numbers
- Date: Fri, 30 Sep 2011 14:40:46 +0000 (UTC)
commit 30f0e23504a4e405489513fa471acb5e0ae022f5
Author: Sam Thursfield <ssssam gmail com>
Date: Fri Sep 30 15:39:27 2011 +0100
tracker-extract: Fix cuesheet track numbers
The TrackerToc object only stores entries relevant to the file currently
being extracted. We need to calculate the track number earlier when we
have knowledge of every track in the cue sheet.
src/tracker-extract/tracker-cue-sheet.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/src/tracker-extract/tracker-cue-sheet.c b/src/tracker-extract/tracker-cue-sheet.c
index 44827a7..c6be5de 100644
--- a/src/tracker-extract/tracker-cue-sheet.c
+++ b/src/tracker-extract/tracker-cue-sheet.c
@@ -188,17 +188,9 @@ process_toc_tags (TrackerToc *toc)
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++) {
+ for (node=toc->entry_list; node; node=node->next) {
TrackerTocEntry *entry = node->data;
- if (gst_tag_list_get_tag_size (toc->tag_list, GST_TAG_TRACK_NUMBER) == 0)
- gst_tag_list_add (entry->tag_list,
- GST_TAG_MERGE_REPLACE,
- 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)
@@ -272,6 +264,13 @@ parse_cue_sheet_for_file (const gchar *cue_sheet,
track_get_cdtext (track),
track_get_rem (track));
+ gst_tag_list_add (entry->tag_list,
+ GST_TAG_MERGE_REPLACE,
+ GST_TAG_TRACK_NUMBER,
+ i,
+ NULL);
+
+
toc->entry_list = g_list_prepend (toc->entry_list, toc_entry);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]