[tracker] tracker-extract: Don't mix artist and albumartist
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-extract: Don't mix artist and albumartist
- Date: Mon, 14 Nov 2016 23:15:11 +0000 (UTC)
commit 4c86ccd902c3e34c6b08c7fa724ee37c083cb384
Author: Marinus Schraal <mschraal src gnome org>
Date: Thu Nov 3 14:45:42 2016 +0100
tracker-extract: Don't mix artist and albumartist
The 'album artist' is not the same thing as the 'performer' or the
'artist' metadata. In some extractors these tags however got mixed to
provide fallback values for certain tags. In the long run this is not a
viable approach: the tracker information should be a true representation
of what is in the tags.
https://bugzilla.gnome.org/show_bug.cgi?id=773697
src/tracker-extract/tracker-cue-sheet.c | 21 ---------------------
src/tracker-extract/tracker-extract-libav.c | 11 -----------
src/tracker-extract/tracker-extract-mp3.c | 10 +++-------
src/tracker-extract/tracker-extract-vorbis.c | 4 +---
4 files changed, 4 insertions(+), 42 deletions(-)
---
diff --git a/src/tracker-extract/tracker-cue-sheet.c b/src/tracker-extract/tracker-cue-sheet.c
index 544de29..5e1b650 100644
--- a/src/tracker-extract/tracker-cue-sheet.c
+++ b/src/tracker-extract/tracker-cue-sheet.c
@@ -198,11 +198,8 @@ set_track_tags_from_cdtext (GstTagList *tag_list,
static void
process_toc_tags (TrackerToc *toc)
{
- GList *node;
gint track_count;
- 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,
@@ -211,24 +208,6 @@ process_toc_tags (TrackerToc *toc)
track_count,
NULL);
}
-
- gst_tag_list_get_string (toc->tag_list, GST_TAG_ALBUM_ARTIST, &album_artist);
-
- for (node = toc->entry_list; node; node = node->next) {
- TrackerTocEntry *entry = node->data;
-
- if (album_artist != NULL) {
- if (gst_tag_list_get_tag_size (entry->tag_list, GST_TAG_ARTIST) == 0 &&
- gst_tag_list_get_tag_size (entry->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-libav.c b/src/tracker-extract/tracker-extract-libav.c
index b2597f9..71a6b94 100644
--- a/src/tracker-extract/tracker-extract-libav.c
+++ b/src/tracker-extract/tracker-extract-libav.c
@@ -167,24 +167,14 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
if ((tag = av_dict_get (format->metadata, "artist", tag, 0))) {
performer = tracker_extract_new_artist (tag->value);
- if (!album_artist) {
- album_artist_name = tag->value;
- album_artist = performer;
- }
}
if (!performer && (tag = av_dict_get (format->metadata, "performer", tag, 0))) {
performer = tracker_extract_new_artist (tag->value);
- if (!album_artist) {
- album_artist_name = tag->value;
- album_artist = performer;
- }
}
if (performer) {
tracker_resource_set_relation (metadata, "nmm:performer", performer);
- } else if (album_artist) {
- tracker_resource_set_relation (metadata, "nmm:performer", album_artist);
}
if ((tag = av_dict_get (format->metadata, "composer", tag, 0))) {
@@ -241,7 +231,6 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
tracker_resource_set_int64 (metadata, "nfo:averageBitrate", format->bit_rate);
}
-
if ((tag = av_dict_get (format->metadata, "comment", NULL, 0))) {
tracker_resource_set_string (metadata, "nie:comment", tag->value);
}
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index ef30342..bfbafa5 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -2355,18 +2355,14 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
md.id3v23.composer,
md.id3v22.composer);
- md.performer_name = tracker_coalesce_strip (7, md.id3v24.performer1,
- md.id3v24.performer2,
+ md.performer_name = tracker_coalesce_strip (4, md.id3v24.performer1,
md.id3v23.performer1,
- md.id3v23.performer2,
md.id3v22.performer1,
- md.id3v22.performer2,
md.id3v1.artist);
- md.album_artist_name = tracker_coalesce_strip (4, md.id3v24.performer2,
+ md.album_artist_name = tracker_coalesce_strip (3, md.id3v24.performer2,
md.id3v23.performer2,
- md.id3v22.performer2,
- md.performer_name);
+ md.id3v22.performer2);
md.album_name = tracker_coalesce_strip (4, md.id3v24.album,
md.id3v23.album,
diff --git a/src/tracker-extract/tracker-extract-vorbis.c b/src/tracker-extract/tracker-extract-vorbis.c
index 9c2b778..47fb982 100644
--- a/src/tracker-extract/tracker-extract-vorbis.c
+++ b/src/tracker-extract/tracker-extract-vorbis.c
@@ -178,8 +178,6 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
if (vd.album_artist) {
album_artist = tracker_extract_new_artist (vd.album_artist);
- } else if (md.creator) {
- album_artist = g_object_ref (md.creator);
} else {
album_artist = NULL;
}
@@ -188,7 +186,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
album_artist,
vd.disc_number ? atoi(vd.disc_number) : 1);
- g_object_unref (album_artist);
+ g_clear_object (&album_artist);
album = tracker_resource_get_first_relation (album_disc, "nmm:albumDiscAlbum");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]