Skip to content
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

Problems encountered implementing AURA #3484

Closed
govynnus opened this issue Feb 9, 2020 · 2 comments
Closed

Problems encountered implementing AURA #3484

govynnus opened this issue Feb 9, 2020 · 2 comments

Comments

@govynnus
Copy link
Member

govynnus commented Feb 9, 2020

I've been having a go at implementing the AURA spec as a beets plugin using the existing web plugin as inspiration, however I've got a few problems.

First, AURA says that the artist, genre, composer and albumartist should be arrays, but in beets Item object these attributes are just single strings and there doesn't seem to be a consistent separator. For example in my library &, /, and - are all used to separate multiple artists. At the moment I'm just returning an array with a single string in it (which is whatever beets gives me), but this hardly seems the right thing to do.

Second, I'm wondering what a recording-mbid is compared to a track-mbid because AURA gives both as optional attributes but beets has mb_trackid (which corresponds to track-mbid) and mb_releasetrackid (which I don't think is the same as a recording-mbid?). Also, AURA mentions framerate and framecount which I thought were related to video rather than audio. This issue might be more AURA than beets related, or could just be my ignorance.

Third, is there a way to get a list of all artists in the database like you can tracks or albums? If not I could do something like beet ls -f '$artist' then remove duplicates, or probably more sensibly use a Transaction object to do some SQL directly. On a related note, is there a way to access the beet ls functionality through the API?

Thanks.

@sampsyo
Copy link
Member

sampsyo commented Feb 9, 2020

Awesome!! This seems like a really good idea. Thanks for looking into it!

At the moment I'm just returning an array with a single string in it (which is whatever beets gives me), but this hardly seems the right thing to do.

I think this is the right place to start! We designed AURA with extensibility in mind, to be ready for whenever beets supports multi-valued fields as first-class citizens (c.f. #505). But absent that, I think a single-value list is the right thing to do.

Second, I'm wondering what a recording-mbid is compared to a track-mbid

Good question. Because of history (namely, the evaluation from MB's old database schema to what they call "NGS"), beets names are a little weird. Namely:

  • mb_trackid: This is the MusicBrainz recording ID.
  • mb_releasetrackid: This is now the ID for the MusicBrainz track.

The framerate and framecount attributes are relevant to audio, though: if you think of "frame" as a synonym for "sample" then maybe they make more sense. 😃

Third, is there a way to get a list of all artists in the database like you can tracks or albums?

There is not, unfortunately. The query you describe is the right thing to do. Tracks and albums are entities in the beets database (distinct from just metadata on other entities), but artists are not.

On a related note, is there a way to access the beet ls functionality through the API?

Absolutely! The items method on the Library class does this. You can provide a string query, but it is probably nicer to provide a Query object programmatically. If you look around for other uses of this method, you should be able to find examples.

@govynnus
Copy link
Member Author

That helps a lot, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants