[tracker-miners/wip/carlosg/backports-for-3-1: 2/6] Separate artist and performer on libav extractor
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/backports-for-3-1: 2/6] Separate artist and performer on libav extractor
- Date: Fri, 11 Jun 2021 15:48:47 +0000 (UTC)
commit e7ac8e28e6f6624a7c969a7f2ad6a9f5af7978a5
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]