-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mbsync: fix updating album with invalid first track MBID #2920
Conversation
Hi! Thing is, with this change, if I'm not mistaken, tracks with an invalid Note however that, when there are multiple candidates, Maybe a solution when there is no available candidate for a given track could be to go through all elements of |
Yes. With invalid track MBID there are no candidates availble for selection later.
This fix doesn't seem to be robust enough. I actually did a few attempts to clean up all tracks with invalid MBID (around 5% of all my collection). None of those attempts managed to figuring out all mappings correctly with high confidence. If we want to stay on the relatively safe side, a |
By wrong mapping, do you mean that tracks have been renumbered in MusicBrainz, and that a mapping based on medium and track numbers only misses this renumbering and thus wrongly identifies the tracks? Wow, I didn't think this could happen: I would've thought disc and track numbers were not prone to frequent changes. But sure, adding an extra check based on |
Not just shuffling, some times tracks could also get removed or added. MusicBrainz, after all, is created by human. Medium list could be wrong and be changed later in any way one can think of. On the other hand, leaving zombie track doesn't hurt much. It's not visible to user (after this PR merged), and won't hurt user in another way later (unless we attempted to fix in an aggressive way and created wrong track mapping). So I would suggest the strict approach if we are going to fix the zombie tracks issue in one way or another. |
Yes, you're absolutely right. Leaving zombie tracks isn't that much of a problem indeed, especially since albums can still be updated (unless all of their recording IDs have changed) thanks to your PR. Thanks! |
Sounds like a good idea to me; thanks! Could you please add a changelog entry describing the change? Also, is there an easy way to write a test showcasing the problem? |
00c621d
to
4a40369
Compare
rebased and added changelog entry.
Hmm, I don't think there is an easy way. However, the fix is actually pretty self explained. I also tested it while fixing zombie tracks from my collection. It works as expected. |
MBID of recording could become invalid after merging. The existing code always copies metadata from first track after updating. But for albums with invalid track MBID that happens to be the first track, MusicBrainz changes won't be applied to whole album, only whose tracks with valid MBID. This is particularly annoying since those changes are actually displayed for every `beet mbsync` run, but never get applied. Fix this issue by finding any track that get MusicBrainz updates, and apply it to whole album.
4a40369
to
69d6dfe
Compare
OK, no big deal. Thanks for looking into it, and thanks for adding the changelog entry too!! ✨ |
mbsync: fix updating album with invalid first track MBID
MBID of recording could become invalid after merging. The existing
code always copies metadata from first track after updating. But for
albums with invalid track MBID that happens to be the first track,
MusicBrainz changes won't be applied to whole album, only whose
tracks with valid MBID. This is particularly annoying since those
changes are actually displayed for every
beet mbsync
run, but neverget applied.
Fix this issue by finding any track that get MusicBrainz updates, and
apply it to whole album.
Some additional comments:
beet mbsync
issues in long term. It still can't handle existing collection with invalid track MBID. Since those tracks won't receive any updates (includingmb_release_trackid
), and becomes "zombie". This pull request won't solve the whole "track MBID missing" issue, just the most annoying part of it.beet mbsync
run. The issue of mbcollection: 'remove' option inadvertently removes merged releases #2914 still exists, but with this pull request at leastbeet mbsync
could become a work around.