-
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
Stop perpetually writing mb_artistid
, mb_albumartistid
and albumtypes
fields
#5540
Stop perpetually writing mb_artistid
, mb_albumartistid
and albumtypes
fields
#5540
Conversation
mb_artistid\
,\ \mb_albumartistid\
\ and\ \albumtypes\
\ fieldsmb_artistid
, mb_albumartistid
and albumtypes
fields
This is so great @snejus. Finally, someone! So far it looks like it's the right thing to do. I'll try find time to look more closely and even play around with it in the next few days. |
d9fb59d
to
7bdb0b5
Compare
Hi @snejus, finally found some time to ressurect my beets-dev environment to play around a little. Unfortunately not the best results yet. It could certainly be that my dev-library is totally messed up. I didn't thoroughly check or clean it up yet. This is what I get: Tests run fine
beet write still gives me loads of these
What else can I do to help/debug? |
I forgot to mention - you need to reimport your music first! Try |
7bdb0b5
to
efffcd7
Compare
|
Thanks for the hint! Yeah mbsync is a good idea but reimport for this one album was good enough for now. Much better now:
but note that data in db is now:
so at least this albumtype data looks properly |
Did an mbsync and all MusicBrainz tagged items are fine now btw! 👍 |
I have a suspicion why albumtype is a problem with Discogs plugin. It only saves a single field |
This change should handle such cases and set |
Ok I understand, that's odd. Anyway I just scrambled together some code that really sets albumtypes in the first place on a re/import. Do you mind if I push a commit to this branch? Just so we can talk about it better. You can revert it later on. |
go ahead! |
Could you by any chance provide |
fb18c62
to
efffcd7
Compare
There you go:
(Missing entirely from the file tag.) Sufficient or you really want to see all tags and lib fields? database, just in case:
|
Thanks. I messaged you on Zulip asking for one of the files in question so that I can test it out |
efffcd7
to
550a9a8
Compare
I found that album metadata was applied after these corrections, where |
5001005
to
a091c2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge it! 🎉
I still found ways to trigger the issue but that was with files that I imported as-is, so manual corrections using beet mod albumtype=something query
and beet mod albumtypes=something query
are the way to fix those. The apply_metadata...
methods are not run in that case, thus it's not possible to correct those on (re)import. We shouldn't try to fix that here, since there "just is" quite some things in beets that depend on properly tagging with a tagging source. Importing as-is, just has flaws. It is what it is, and fixing that is for another day. :-)
Most of all: Thank you! Fixing this was long due. You secured yourself an entry in the books of "beets history" with that! ❤️
@snejus Seeing this error with Traceback (most recent call last):
File "/home/arsaboo/.local/bin/beet", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/arsaboo/.local/lib/python3.12/site-packages/beets/ui/__init__.py", line 1870, in main
_raw_main(args)
File "/home/arsaboo/.local/lib/python3.12/site-packages/beets/ui/__init__.py", line 1849, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/home/arsaboo/.local/lib/python3.12/site-packages/beetsplug/mbsync.py", line 73, in func
self.albums(lib, query, move, pretend, write)
File "/home/arsaboo/.local/lib/python3.12/site-packages/beetsplug/mbsync.py", line 183, in albums
any_changed_item = items[0]
~~~~~^^^
IndexError: list index out of range I will create a PR to check for empty albums. |
@arsaboo could you check whether this errors out before this change was merged? Doesn't seem like it's related |
It is quite possible that those errors are unrelated to this PR (I ran |
This PR fixes an issue where the
beet write
command repeatedly shows differences for certain fields (mb_artistid
,mb_albumartistid
,albumtype
) even after writing the tags.This happens because these fields are actually stored as lists in the media files (
mb_artistids
,mb_albumartistids
,albumtypes
), but beets maintains both single and list versions in its database.This PR addresses this issue in a non-invasive way: the fix ensures consistency between single fields and their list counterparts by:
This resolves long-standing issues #5265, #5371, and #4715 where users experienced persistent "differences" in these fields despite writing tags multiple times.
Changes:
ensure_consistent_list_fields()
function to synchronize field pairsFixes #5265, #5371, #4715
Note: your music needs to be reimported with
beet import -LI
or synchronised withbeet mbsync
in order to fix these fields!