Intermediary broker between ListenBrainz/MusicBrainz and Discord RPC
Go to file
Thord Johansson 90eca9e76a Enhance config handling and album art logic
- Refactored variable names for clarity, changing `data` to `config_data` to better indicate its purpose related to configuration settings.
- Significantly enhanced the album art determination logic to prioritize MusicBrainz data when configured, with a fallback to YouTube thumbnails if necessary.
- Introduced `FindMusicBrainzRelease` method for searching MusicBrainz releases based on the release name, aiming for exact alphanumeric matches or the highest scoring match.
- Added `EqualsAlphanumeric` utility method for accurate alphanumeric string comparisons, supporting the MusicBrainz release search functionality.
2024-06-18 23:40:12 +02:00
.gitignore Initial commit 2024-06-02 17:42:01 +02:00
Program.cs Enhance config handling and album art logic 2024-06-18 23:40:12 +02:00 Minor formatting edits in README 2024-06-02 17:47:14 +02:00
config.ini.example Initial commit 2024-06-02 17:42:01 +02:00
lbz-rpc.csproj Initial commit 2024-06-02 17:42:01 +02:00
lbz-rpc.sln Initial commit 2024-06-02 17:42:01 +02:00

ListenBrainz-DiscordRPC Broker

This is a simple broker that watches a ListenBrainz now-playing status and sends it to Discord RPC.

NOTE: An account on ListenBrainz will be required to use this broker.

Usage as standalone application

The project can be run directly by simply running dotnet run in the project directory. This will start the broker and begin sending now-playing status to Discord RPC. You can also start the executable directly from the binary output directory; note that a valid configuration file must be present in the same directory as the executable.

NOTE: This project has not been tested on Linux but should work with minimal changes. The Windows service functionality will not work on Linux.

Installation as a Windows Service

Alternatively, this project uses Topshelf to install as a Windows service. To install it, run the following command (as administrator):

lbz-rpc.exe install

To uninstall the service, run the following command:

lbz-rpc.exe uninstall

While installed you can manage the service using Services (services.msc) or the Topshelf command line (lbz-rpc.exe start, lbz-rpc.exe stop, lbz-rpc.exe restart).


In a file called config.ini, provide the necessary details:

discord_token = ###
listenbrainz_username = your_username_here
poll_interval = 10
ignored_sources = jellyfin

Explanation of the fields:

  • discord_token: The token of your Discord application. You can create a new application and get the token from the Discord Developer Portal.
  • listenbrainz_username: Your ListenBrainz username.
  • poll_interval: The interval in seconds at which the broker will poll ListenBrainz for now-playing status.
  • ignored_sources: A comma-separated list of sources to ignore. This is useful if you want to ignore certain sources from being sent to Discord RPC (such as if you're already using jellyfin-rpc and want this to catch everything else).


This broker does not scrobble tracks to ListenBrainz. If you want to scrobble tracks, here are some suggestions:

  • Web Scrobbler for Firefox - A browser extension that scrobbles tracks from various sources. Recommend configuring to ignore media that is not categorised as music.
  • jellyfin-plugin-listenbrainz - A Jellyfin plugin that scrobbles tracks from Jellyfin to ListenBrainz.

For more suggestions, see the official ListenBrainz website.