| 1 |
.. _listenbrainz: |
| 2 |
|
| 3 |
ListenBrainz Plugin |
| 4 |
=================== |
| 5 |
|
| 6 |
The ListenBrainz plugin for beets allows you to interact with the ListenBrainz |
| 7 |
service. |
| 8 |
|
| 9 |
Configuration |
| 10 |
------------- |
| 11 |
|
| 12 |
To enable the ListenBrainz plugin, add the following to your beets configuration |
| 13 |
file (config.yaml_): |
| 14 |
|
| 15 |
.. code-block:: yaml |
| 16 |
|
| 17 |
plugins: |
| 18 |
- listenbrainz |
| 19 |
|
| 20 |
You can then configure the plugin by providing your Listenbrainz token (see |
| 21 |
intructions here_) and username: |
| 22 |
|
| 23 |
:: |
| 24 |
|
| 25 |
listenbrainz: |
| 26 |
token: TOKEN |
| 27 |
username: LISTENBRAINZ_USERNAME |
| 28 |
|
| 29 |
Usage |
| 30 |
----- |
| 31 |
|
| 32 |
Once the plugin is enabled, you can import the listening history using the |
| 33 |
``lbimport`` command in beets. |
| 34 |
|
| 35 |
The command has two command-line options: |
| 36 |
|
| 37 |
- To import the listening history from a ListenBrainz export file, use the |
| 38 |
``-f`` (``--export-file``) flag followed by the path to the export file. |
| 39 |
- To limit the number of listens fetched via the API during import, the |
| 40 |
``--max`` flag can be used. By default, the plugin will fetch all listens. |
| 41 |
This option will be ignored when an export file is provided. |
| 42 |
|
| 43 |
Matched tracks are populated with the ``listenbrainz_play_count`` field, which |
| 44 |
you can use in queries and templates. For example: |
| 45 |
|
| 46 |
:: |
| 47 |
|
| 48 |
$ beet ls -f '$title: $listenbrainz_play_count' listenbrainz_play_count:1.. |
| 49 |
|
| 50 |
This field is separate from ``lastfm_play_count`` used by :doc:`lastimport` and |
| 51 |
``play_count`` used by :doc:`mpdstats`, so importing play counts from one plugin |
| 52 |
does not overwrite the others. |
| 53 |
|
| 54 |
.. _config.yaml: ../reference/config.rst |
| 55 |
|
| 56 |
.. _here: https://listenbrainz.readthedocs.io/en/latest/users/api/index.html#get-the-user-token |