beets icon indicating copy to clipboard operation
beets copied to clipboard

Fetch `remixer` field from MusicBrainz

Open TypicalFence opened this issue 1 year ago • 1 comments

Problem

Musicbrainz seems to have a field called remixer for remixes, this info isn't written to my files.

Example: https://musicbrainz.org/release/7c7f7ddf-c021-4ee8-993d-d1c330b4a36a

Using it for the artist field, similarly to the artist_credit option would also be nice.

According to the Picard docs there would even be a proper place to store it in ID3.

Setup

  • OS: Arch Linux
  • Python version: 3.10
  • beets version: 1.6.0
  • Turning off plugins made problem go away (yes/no): no

TypicalFence avatar Jul 28 '22 16:07 TypicalFence

Sounds like a reasonable thing to add! Hopefully it shouldn't be too hard (the place to do it is in beets/autotag/mb.py).

sampsyo avatar Jul 30 '22 23:07 sampsyo

I am currently working on this. It is my first time contributing to beets so I might take some time to get familiar with the codebase and structure.

Bootjewolf avatar Nov 01 '22 21:11 Bootjewolf

Awesome! Let us know with a Discussion post if you have any code-level questions we can answer.

sampsyo avatar Nov 02 '22 01:11 sampsyo

So after looking at the example given by @TypicalFence I can see the remixer field on the musicbrainz website. However, looking at the JSON or XML that is available from the muiscbrainz website I can't find the remixer mentioned anywhere except for the title. I don't know how to proceed since to me it seems like this information isn't available through the api queries beets makes at the moment. Is this the case or am i missing something?

Bootjewolf avatar Nov 03 '22 19:11 Bootjewolf

@Bootjewolf I just went over the musicbrainz api docs.

The remixer tag is a artist relation. When we include artist-rels in a request of a recording from the album we get the following: JSON, which includes a relation of the type remixer. :tada:

Now for that to work for the requests that you posted we need to include recording-level-rels, which just tells musicbrainz to resolve the rels on a recording (track/song) level.

This leaves us with the following url: https://musicbrainz.org/ws/2/release/7c7f7ddf-c021-4ee8-993d-d1c330b4a36a?inc=aliases%2Bartist-credits%2Blabels%2Bdiscids%2Brecordings%2Bartist-rels%2Brecording-level-rels&fmt=json

You can find this in the api docs here.

The api is rather complicated tbh.

TypicalFence avatar Nov 04 '22 14:11 TypicalFence

Thank you! I will have another look at it this coming week.

Bootjewolf avatar Nov 06 '22 16:11 Bootjewolf

According to my tests I have successfully implemented it in PR #4549.

Bootjewolf avatar Nov 15 '22 17:11 Bootjewolf