Write MUSICBRAINZ_TRACKID to file tags on "Complete tags automatically"#2056
Merged
jonaski merged 1 commit intostrawberrymusicplayer:masterfrom Apr 8, 2026
Merged
Conversation
Previously, "Complete tags automatically" retrieved the MusicBrainz recording UUID via AcoustID, used it internally to query the MusicBrainz API for metadata, then discarded it — the UUID never entered the Result struct and could not reach the tag-write path. Only standard metadata (title, artist, album, year, track number) was written to files. This change wires the recording UUID through the full pipeline: - MusicBrainzClient::Result gains a musicbrainz_recording_id_ field - MbIdRequestFinished receives the mbid it looked up and stamps it onto every Result produced from that request - TagFetcher::TagsFetched copies the field onto the Song built from each Result - TrackSelectionDialog::SaveData includes musicbrainz_recording_id in the set of fields copied to the file Tag write support added for all formats: - ID3v2 (MP3, WAV, AIFF): TXXX frame with description "MUSICBRAINZ_TRACKID" - Vorbis comments (FLAC, OGG, Opus): MUSICBRAINZ_TRACKID field - APE tags (WavPack, Musepack, Monkey's Audio): MUSICBRAINZ_TRACKID item - MP4/iTunes (M4A, AAC): ----:com.apple.iTunes:MusicBrainz Track Id - ASF/WMA: MusicBrainz/Track Id attribute A matching read path for the TXXX case is also added so that tags written by this code are read back into the Strawberry database on the next scan.
65664e5 to
0a9448b
Compare
jonaski
approved these changes
Apr 8, 2026
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
"Complete tags automatically" retrieves the MusicBrainz recording UUID via AcoustID, uses it to query the MusicBrainz API for metadata, then silently discards it. The UUID never enters the
Resultstruct and cannot reach the tag-write path. Only standard metadata (title, artist, album, year, track number) is written to files.Solution
Wire the recording UUID through the full pipeline so it is written to file tags alongside the other metadata.
Changes
src/musicbrainz/musicbrainzclient.h/.cppResultgains amusicbrainz_recording_id_fieldMbIdRequestFinishedreceives thembidit looked up (already captured in the lambda) and stamps it onto everyResultproduced from that requestsrc/musicbrainz/tagfetcher.cppTagsFetchedcopiesmusicbrainz_recording_id_onto theSongbuilt from eachResultsrc/dialogs/trackselectiondialog.cppSaveDataincludesmusicbrainz_recording_idin the set of fields copied to the file on user confirmationsrc/tagreader/tagreadertaglib.cppMUSICBRAINZ_TRACKIDMUSICBRAINZ_TRACKIDfieldMUSICBRAINZ_TRACKIDitem----:com.apple.iTunes:MusicBrainz Track IdMusicBrainz/Track IdattributeMUSICBRAINZ_TRACKIDso tags written by this code are read back into the database on the next scanNotes
!isEmpty()— no empty tags are writtenmusicbrainz_recording_idis preserved for files tagged by external tools (Picard, beets)SetAsfAttributehelper which already handles empty-string removal