[tracker-miners: 1/2] Separate artist and performer on libav extractor
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners: 1/2] Separate artist and performer on libav extractor
- Date: Wed, 5 May 2021 13:49:05 +0000 (UTC)
commit 138615f65ead201eb4a70a62b5410b5b3e9dcdaa
Author: Pekka Vuorela <pekka vuorela jolla com>
Date: Wed May 5 14:03:00 2021 +0300
Separate artist and performer on libav extractor
As done on many other places, with Tracker!261 the artist is now
the main artist of a song.
src/tracker-extract/tracker-extract-libav.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-libav.c b/src/tracker-extract/tracker-extract-libav.c
index ee24bd574..f3eb9e393 100644
--- a/src/tracker-extract/tracker-extract-libav.c
+++ b/src/tracker-extract/tracker-extract-libav.c
@@ -150,7 +150,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info,
}
} else if (audio_stream) {
- TrackerResource *album_artist = NULL, *performer = NULL;
+ TrackerResource *album_artist = NULL, *artist = NULL, *performer = NULL;
char *album_artist_name = NULL;
char *album_title = NULL;
@@ -180,10 +180,10 @@ tracker_extract_get_metadata (TrackerExtractInfo *info,
}
if ((tag = find_tag (format, audio_stream, "artist"))) {
- performer = tracker_extract_new_artist (tag->value);
+ artist = tracker_extract_new_artist (tag->value);
}
- if (!performer && (tag = find_tag (format, audio_stream, "performer"))) {
+ if ((tag = find_tag (format, audio_stream, "performer"))) {
performer = tracker_extract_new_artist (tag->value);
}
@@ -194,6 +194,10 @@ tracker_extract_get_metadata (TrackerExtractInfo *info,
}
}
+ if (artist) {
+ tracker_resource_set_relation (metadata, "nmm:artist", artist);
+ }
+
if (performer) {
tracker_resource_set_relation (metadata, "nmm:performer", performer);
}
@@ -220,6 +224,9 @@ tracker_extract_get_metadata (TrackerExtractInfo *info,
g_object_unref (album_disc);
}
+ if (artist)
+ g_object_unref (artist);
+
if (performer)
g_object_unref (performer);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]