Discourse plugin to show a user's ListenBrainz listening in their profile
Use buildMbidUrl helper also for artist credits
Fixed preferences test



You can also use your local clone with git send-email.

#ListenBrainz plugin for Discourse

This Discourse plugin allows users to showcase their recent listenings from ListenBrainz in their user profile.

For more details and usage example see the Show your ListenBrainz listenings in your forum user profile on the MetaBrainz community forums.


Please follow this official plugin installation how-to. Use https://git.sr.ht/~phw/discourse-listenbrainz as the git clone URL.

#Admin settings

You can configure the ListenBrainz plugin in the Discourse admin interface. The following options are available:

  • listenbrainz enable: Allow users to show their ListenBrainz status in their profiles. Default: enabled.

  • listenbrainz username matches discourse: Enable this if the usernames of the Discourse users usually match their ListenBrainz usernames. The users can still configure a different ListenBrainz username, but it will be pre-filled with their Discourse username. This option is primarily intended to be used on the MetaBrainz community forums. Default: disabled.

  • listenbrainz poster icon: Allow users to show a link to their ListenBrainz profile next to their username in each post. Default: enabled.

#User settings

Each user stays in control whether their ListenBrainz activity gets shown in their profile. The users can configure this in their profile preferences. The following preferences are available.

  • Show ListenBrainz information in my user profile: When enabled an infobox with details of the user's ListenBrainz profile will be shown in the user's user card and user profile. The content of the infobox can be configured with the options below. Default: disabled.

  • ListenBrainz username: The user's ListenBrainz username. Must be set in order for the ListenBrainz details to show up for the user. If listenbrainz username matches discourse is enabled for the site than this defaults to the Discourse username, otherwise the default is empty.

  • Show a link to my ListenBrainz profile next to my Discourse username: When enabled a link to the user's ListenBrainz profile is shown next to their username in each post. This option is only available if the site has listenbrainz poster icon enabled. Default: disabled.

  • Display: Configures the content shown in the ListenBrainz infobox. The following options are available:

    • Most recent listen: Show the user's currently playing track or the most recently played track.

    • User profile statistics: Show general statistics for the user's ListenBrainz profile, such as listen count, most played track and release cover art of the most played releases.

    • Most recent listen with fallback to user profile statistics: Attempt to show the recent listen, but if none is available fall back to showing the user profile statistics. This is the default setting.

  • Time range: Select the time range for which the user profile statistics get generated. Default: This month.

  • Fallback to larger time range if there are no listens in the selected range: If enabled, the profile statistics view will automatically fall back to a larger time range if you had no listens in the selected time range. E.g. if you have selected "This week" but have no listens recorded in the current week then the statistics will fall back to show "This month". Default: enabled.

  • Show pinned recording instead of recent listen, if available: If you have pinned a recording on ListenBrainz enabling this option will cause the listen card to show the pin instead of the most recent listen. This will also show the blurb you entered when pinning the recording. If you have no pin it will fall back to show the most recent listen.

  • Show recent listen not older than: Do not show the user's last played track if it is older than the given time. Default: 24 hours.


The source code for this plugin is available on SourceHut. To report issues or feature requests please create a ticket or discuss on the ListenBrainz plugin thread in the MetaBrainz community forums.

Patches can be submitted to the mailing list ~phw/musicbrainz@lists.sr.ht. You can clone the repository directly on SourceHut and submit your changes with the "Prepare patchset" button. Please see SourceHut's documentation for sending patches upstream for details.

You can help translate this plugin into your language with Weblate. Please request new languages on the mailing list ~phw/musicbrainz@lists.sr.ht.


Discourse ListenBrainz plugin © 2023-2024 Philipp Wolfer ph.wolfer@gmail.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See COPYING for details.

All user interface strings and their translations are published under the conditions of CC0 1.0 Universal (CC0 1.0).