beetbox / beetbox/beets

mbcollection: Cannot add to a collection of "recordings"

Open
#3,549 8 comments 0 reactions 0 assignees View on GitHub
feature mbcollection
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

### Use case

I'm trying to use beets' mbcollection plugin to push my library's tracks (recordings in MB terminology) to a collection of type `recordings`.

I get an HTTP 400: Bad Request when using the collection id for a Recording Collection but it works fine with a collection id for a Releases Collection.

### Solution

Add support to mbcollection plugin to be able to handle collections of recordings too. I can see that the MB web service has an API for the same but it looks like the python bindings don't expose all the knobs on it. From the docs at https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2

> collections
>
> To add or remove releases (for example) from your collection, perform a PUT or DELETE request to /ws/2/collection//releases, respectively:
>
> PUT /ws/2/collection/f4784850-3844-11e0-9e42-0800200c9a66/releases/455641ea-fff4-49f6-8fb4-49f961d8f1ad;c410a773-c6eb-4bc0-9df8-042fe6645c63?client=example.app-0.4.7
> DELETE /ws/2/collection/f4784850-3844-11e0-9e42-0800200c9a66/releases/455641ea-fff4-49f6-8fb4-49f961d8f1ad;?client=example.app-0.4.7
>
> Other types of entities supported by collections can be submitted, too; just substitute "releases" in the URI with one of: areas, artists, events, labels, places, recordings, release-groups, or works, depending on the type of collection.

## Proposal

1. Upstream a change to the Python bindings to pass identifiers allowing the handling of all types of collections.
1. Introduce a new key to the mbcollection plugin config called `type` which can be one of areas, artists, events, labels, places, recordings, release-groups, works, or releases.
1. Use the config in the plugin to decide which metadata field to submit to MB API.

## Alternative

1. Upstream a change to the Python bindings to pass identifiers allowing the handling of all types of collections.
1. Create a new plugin for this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.