# How to use mbcollection plugin?

**URL:** <https://discourse.beets.io/t/how-to-use-mbcollection-plugin/1334>\
**Category:** Help\
**Created:** [June 8, 2020, 1:50pm UTC](https://discourse.beets.io/t/how-to-use-mbcollection-plugin/1334 "2020-06-08T13:50:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![trolley](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/trolley/32/431_2.png) [@trolley](https://discourse.beets.io/u/trolley)\
**Post date:** [June 8, 2020, 1:50pm UTC](https://discourse.beets.io/t/how-to-use-mbcollection-plugin/1334/1 "2020-06-08T13:50:15Z")

</div>

I’m setting up beets for the first time but I can’t get the `mbcollection` plugin to work. I’m not understanding the [documentation](https://beets.readthedocs.io/en/stable/plugins/mbcollection.html), and it doesn’t seem to be behaving as I’d expect.

On the plugin docs page it says there’s a `collection` option but no info on what value should go there. I’m assuming the MBID of the collection, but that’s just a guess. Regardless, no matter what I put in that option beets is trying to update a different collection and failing with an HTTP 400 error. I don’t know how to get the log to see why exactly. It also doesn’t explain what the `remove` option should have as a value. Here’s the relevant section of my config:

```auto
musicbrainz:
    user: myuser
    pass: 'redacted'
    auto: yes
    collection: mbid_of_collection
    remove: what_goes_here

```

And here’s what happens when I try to run the `mbupdate` command:

```auto
$ beet -vv mbupdate
user configuration: /config/config.yaml
data directory: /config
plugin paths:
Sending event: pluginload
ImageMagick version check failed: [Errno 2] No such file or directory: 'magick'
ImageMagick version check failed: [Errno 2] No such file or directory: 'convert'
artresizer: method is (1, (0,))
inline: adding item field multidisc
inline: adding item field disc_has_subtitle
library database: /config/musiclibrary.blb
library directory: /shared/Lossless Music
Sending event: library_opened
mbcollection: Updating MusicBrainz collection a_different_collection_mbid...
error: MusicBrainz API error: caused by: HTTP Error 400: Bad Request

```

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [June 8, 2020, 5:57pm UTC](https://discourse.beets.io/t/how-to-use-mbcollection-plugin/1334/2 "2020-06-08T17:57:19Z")

</div>

Hello! Any chance you’re running into this bug?

> <https://github.com/beetbox/beets/issues/3131>
>
> Problem
> Hey, I was trying to add my music collection to Musicbrainz, but got the following error:
> error: MusicBrainz API error: caused by:...

I do think that should be a collection MBID in the config, yes.

---

<div class="post-metadata">

**Author:** ![trolley](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/trolley/32/431_2.png) [@trolley](https://discourse.beets.io/u/trolley)\
**Post date:** [June 8, 2020, 6:09pm UTC](https://discourse.beets.io/t/how-to-use-mbcollection-plugin/1334/3 "2020-06-08T18:09:37Z")

</div>

Hi adrian, thanks for your answer. It made me realise the problem is my config! I didn’t read the `mbcollection` docs closely enough and put all options under `musicbrainz:` when only `user` and `pass` should be. Since my `collection` option wasn’t in the `mbcollection:` section it was trying to add releases to the wrong collection type, just as the bug report says.

After fixing this it’s working as expected.

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [June 8, 2020, 6:20pm UTC](https://discourse.beets.io/t/how-to-use-mbcollection-plugin/1334/4 "2020-06-08T18:20:58Z")

</div>

That’d do it!! I suppose it would be nice if the error message were more helpful, but I’m glad you figured it out.
