-
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
Parse secondary album types from MusicBrainz #2200
Comments
Thanks for the report! It looks like release groups are now allowed to have "secondary" types. See the XML here: https://musicbrainz.org/ws/2/release-group/19e6209b-2ddc-30b8-9273-484bd075fe7b We currently only parse the primary type, but we should consider getting the rest of them too. |
Hi ! We want both the primary tag and the secondary tag to be displayed or check if the primary is a non-useful tag (for eg, 'other') and accordingly use the secondary tag ? (P.S. I'm unable to claim tasks at the moment due to parental consents issue, should be able to soon) |
Hi, @anshuman73! Great! Let's start by using all the album types. We can just just join them all into a single string using a comma or a semicolon for now. That should work well for a first implementation, and we can consider more nuanced policies in a later phase. |
Sure, also, does beets use a local musicbrainz server or uses the api via http ? |
There's no local server; it uses the public API. The code in question here is |
oh, thanks ! |
@anshuman73 Ack! I answered that question incorrectly—I was thinking of a different thread. The actually relevant code is in Sorry about that! 😳 Please disregard my earlier comment. |
@sampsyo No issues. I believe this is where I'd be focusing at ? https://github.com/beetbox/beets/blob/master/beets/autotag/mb.py#L280 |
Yep, exactly! |
Also, is there any place where I can see example json/dictionary data given out ? |
Comparing it to the xml example given above, I cannot find a tag named "type", so I'm assuming it defaults to the primary-type tag ? |
There's no place where it currently gets printed out, so I'd suggest temporarily inserting a If you're interested in seeing (and experimenting with) how the XML is parsed precisely, the py-mb-ngs code might be the right place to look: https://github.com/alastair/python-musicbrainzngs/blob/master/musicbrainzngs/mbxml.py#L477 |
Ahh that's just perfect. |
@sampsyo I think I've written the required code, I just can't figure out how to pass a release result to test the function. |
Sure! The test input is defined here: Line 31 in 9de27c6
You can add a test method to that class to demonstrate the new data extraction. |
hmm, well it doesn't exactly have the primary type and secondary type fields. I just wanted to confirm the key names and whether secondary types are stored as a list or not. (though I checked the same from https://github.com/alastair/python-musicbrainzngs/blob/master/musicbrainzngs/mbxml.py) |
Aha! Yes, you'll want to try running beets so it executes a real query in that case—and then check the data that gets returned by adding a |
Hmm, I'll build it from my local source by simply executing the setup.py ? |
Good question! This wiki page has instructions for getting set up with a local installation: In particular, I'd recommend |
o.O I never knew about such an easy pip method existing for local installation. |
Arg! Thanks for the reminder, @mineo—we should have noticed that a long time ago. As you suggested back on that ticket, the right way to resolve this is probably to store the types in separate tags. |
Good question. Since it has to do with which fields we set on the imported items, let's worry about it after #1547. |
I just merged #2294, which should log the multiple album types to beets's debug output. If you're interested in finishing off this feature, please try importing a few albums with that debug output enabled to check what's going on with the difference between the current one-shot album type and the new data—that will help us decide how to handle the new album types. |
My audiobooks are still being imported as albumtype "other" on the latest linuxserver release. |
Is there any plan on finishing this? Or is there any way of using the secondary types in a path format? |
Oh hey you still need some samples, I think. Here's the file that led me to this issue number.
|
If you add this functionality I'd love to be able to force an album type on command line, since audiobooks actually being tagged as such in musicbrainz is rather rare, it seems.
|
Problem
I've different radio plays. If i import one (e.g. https://musicbrainz.org/release-group/19e6209b-2ddc-30b8-9273-484bd075fe7b) to my library the ALBUMTYPE tag is always "other". The Musicbrainz site says "other + spokenword". I think the ALBUMTYPE should be "spokenword" instead. "other" is pretty useless.
Setup
My configuration (output of
beet config
) is:The text was updated successfully, but these errors were encountered: