[tracker-miners/wip/jfelder/fix-musicbrainz-writeback] tracker-writeback: Fix support for musicbrainz release tags




commit 63c16dd67cfd93dc5ef35945d0640ba7bd916909
Author: Jean Felder <jean felder gmail com>
Date:   Fri Aug 6 15:22:26 2021 +0200

    tracker-writeback: Fix support for musicbrainz release tags
    
    The Musicbrainz Release and Release_Group tags are set on a Album
    resource, not a Disc.

 src/tracker-writeback/tracker-writeback-gstreamer.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-gstreamer.c 
b/src/tracker-writeback/tracker-writeback-gstreamer.c
index d83c9a13e..079030cb1 100644
--- a/src/tracker-writeback/tracker-writeback-gstreamer.c
+++ b/src/tracker-writeback/tracker-writeback-gstreamer.c
@@ -732,6 +732,16 @@ writeback_gstreamer_write_file_metadata (TrackerWritebackFile  *writeback,
                        album = tracker_resource_get_first_relation (resource, prop);
 
                        if (album) {
+                         const gchar *mb_tags[] = {
+                                       "https://musicbrainz.org/doc/Release";,
+                                       "https://musicbrainz.org/doc/Release_Group";,
+                                       NULL,
+                               };
+
+                         handle_musicbrainz_tags (album,
+                                                  "tracker:hasExternalReference",
+                                                  element, mb_tags);
+
                                album_name = tracker_resource_get_first_string (album, "nie:title");
                                artist = tracker_resource_get_first_relation (album, "nmm:albumArtist");
                        }
@@ -859,22 +869,12 @@ writeback_gstreamer_write_file_metadata (TrackerWritebackFile  *writeback,
                        disc = tracker_resource_get_first_relation (resource, prop);
 
                        if (disc) {
-                               const gchar *mb_tags[] = {
-                                       "https://musicbrainz.org/doc/Release";,
-                                       "https://musicbrainz.org/doc/Release_Group";,
-                                       NULL,
-                               };
-
                                number = tracker_resource_get_first_int (disc,
                                                                         "nmm:setNumber");
                                g_value_init (&val, G_TYPE_INT);
                                g_value_set_int (&val, number);
                                writeback_gstreamer_set (element, GST_TAG_ALBUM_VOLUME_NUMBER, &val);
                                g_value_unset (&val);
-
-                               handle_musicbrainz_tags (disc,
-                                                        "tracker:hasExternalReference",
-                                                        element, mb_tags);
                        }
                }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]