spotify, deezer: Store IDs in dedicated fields instead of MusicBrainz fields#6349
spotify, deezer: Store IDs in dedicated fields instead of MusicBrainz fields#6349aaronk6 wants to merge 1 commit intobeetbox:masterfrom
Conversation
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6349 +/- ##
==========================================
+ Coverage 68.95% 68.97% +0.01%
==========================================
Files 140 140
Lines 18685 18699 +14
Branches 3058 3060 +2
==========================================
+ Hits 12885 12897 +12
- Misses 5153 5154 +1
- Partials 647 648 +1
🚀 New features to boost your workflow:
|
|
This is a long-standing issue and, in my view, an inconsistency that stems from Beets’ shift from MusicBrainz as the primary metadata source to treating it as just one of several common metasource plugins. You are doing two things here which I would split into two PRs/issues imo.
Regarding 1Have you considered migration paths for older databases that currently store Spotify or Deezer IDs in MusicBrainz fields? If we change this behavior, existing databases would need to be migrated to the new format; otherwise, we risk introducing a significant number of inconsistencies. Planning a robust migration strategy is essential to maintain data integrity across different metadata sources. For context: this is one reason we haven’t tackled this yet, fully migrating the behavior will likely snowball and require careful coordination with all metasource plugins to ensure consistency. Regarding 2This seems like a useful addition if there is software that actually reads these tags and does something meaningful with them. Can you provide examples of software that uses them? If not, I would lean toward not adding the metadata to the files. What you describe as issue seems more like a bug to me: |
|
@semohr Thanks for looking into this! I agree, let’s split this up. I’ll create a new PR that ensures that non-MusicBrainz IDs aren’t written to the For the migration strategy, my suggestion is adding a note to the changelog that recommends running the following command to clear everything from In a second step, I’ll see if it’s actually useful to introduce new fields for 3rd-party meta data provider IDs. My gut feeling is that might be good to keep them, even if no client supports them (yet). It could be a nice addition to player clients to link to the respective service. Let me know your thoughts. |
|
As @semohr mentioned, this is a long-standing and very thorny issue. We currently use
|
|
The new PR unfortunately renders beets useless for items tagged with non-musicbrainz data source. I don't see a viable solution to this issue for now (which doesn't require a huge breaking change to our central ID storage mechanism). I the future, I imagine we will need to introduce fields such as |
|
@snejus Sorry for jumping ahead here, and thanks for the detailed explanation. I’ll hold off for now. If there’s anything I can help with as part of the bigger overhaul, feel free to let me know. |
|
Just asking: Wasn't one of the issues also that the In my reply above that was 2. |
|
Yes, from my point of view, the fact that non-MusicBrainz IDs end up in the MusicBrainz tags in the file is the main problem here. Example: MusicBrainz Album Artist Id, MusicBrainz Album Id, MusicBrainz Artist Id, and MusicBrainz Track Id are filled with Deezer IDs (same applies to Spotify if that was used for tagging). Music Assistant rejects these files: So users who use beets for tagging (with Spotify or Deezer meta data) cannot play their files in Music Assistant. This is where I was coming from when creating this PR. Want me to create a separate bug report for this? |
Yes please! |
Description
Previously the Spotify and Deezer plugins wrote their IDs into the MusicBrainz fields. This prevents those files from being imported into Music Assistant, which checks for valid MusicBrainz IDs during import and refuses to import those files (error: “Invalid MusicBrainz identifier”).
I considered fixing this in Music Assistant, but it seemed cleaner to store Spotify and Deezer IDs in separate fields from the start.
This change adds dedicated fields when tagging and leaves the MusicBrainz ID fields untouched:
spotify_track_id,spotify_album_id,spotify_artist_iddeezer_track_id,deezer_album_id,deezer_artist_idI’m curious whether the current behavior is considered a feature or a bug. That is, if there are any cases where populating MusicBrainz ID fields with non-MusicBrainz values is actually useful.
If this turns out to be controversial, making it configurable could be a solution, allowing users to preserve the old behavior.
Looking forward to your thoughts!
To Do