ListenBrainz plugin for Rhythmbox and support in Lollypop

plugin
player
Tags: #<Tag:0x00007fcd7ea97268> #<Tag:0x00007fcd7ea97128>

#1

I have created an initial version of a ListenBrainz plugin for Rhythmbox. Install instructions are on the plugin page. In order to use it you have to enable the plugin in Rhythmbox and then set your ListenBrainz user token in the plugin’s preferences.

The plugin will submit playing now and listened notifications to ListenBrainz. A missing feature currently is offline support, it will only submit listens if there is an online connection and otherwise drop the submission silently. I plan to add offline support as well.

On a related note the great Lollypop player also merged my patch to add ListenBrainz support recently. The next stable release should include it.


List of native ListenBrainz API apps and in development apps
#2

Great! I’ll give those players a try. Did they handle large collections well (especially scanning for files re-tagged by Picard)? Thats the reason I use gmusicbrowser. The only one I found so far which doesn’t scan the whole collection for eternity on smaller changes. Any chances to get your plugin for quodlibet and gmusicbrowser too?


#3

I can’t say for Lollypop. It seems quite fast, but I haven’t used it too much to really tell. Also still a bit buggy. Rhythmbox can handle large collections. It’s for sure not the most fancy and modern player out there, but it is feature rich and stable (first code dates back 2002) and still gets frequent development activity, even though it is clearly in maintencance mode (bugfixes mostly).

For quodlibet maybe, see this feature request. I didn’t know gmusicbrowser. It shouldn’t bee too hard to adapt the existing audioscobbler plugin for the ListenBrainz API, but I will definitely not work on this (because of time and Perl).

If you just want a quick hack to use ListenBrainz with gmusicbrowser, edit the audioscrobbler.pm plugin file and replace http://post.audioscrobbler.com with http://proxy.listenbrainz.org in https://github.com/squentin/gmusicbrowser/blob/master/plugins/audioscrobbler.pm#L136 . Then set your MusicBrainz username as the user and the ListenBrainz user token as password in the plugin settings. This will use the Last.fm compatibility API of ListenBrainz. I did not test this, but give it a try :wink:


List of native ListenBrainz API apps and in development apps
#4

Very cool. I’m not a Linux user myself but it’s always nice to see more choice.


#5

@outsidecontext should I type the ListenBrainz token inside the settings.py and/or settings.ui files or should the gui in rhythmbox ask me about it?


#6

The plugin provides a preferences dialog for this. When activating the plugin there is a “Preferences” button on the lower right:

grafik


#7

@outsidecontext

System: Ubuntu 17.10 Artful Aardvark MATE edition (what distro or system did you try on?)
Rhythmbox player version: 3.4.1 (what version did you try on?)

After unpacking rhythmbox-plugin-listenbrainz-master.zip I put the contents in /home/myuser/.local/share/rhythmbox/plugins/ thus the listenbrainz.plugin file is located in /home/myuser/.local/share/rhythmbox/plugins/listenbrainz.plugin


#8

I tried with Rhythmbox 3.4.2. Put the contents (at least the listenbrainz folder and the listenbrainz.plugin file) directly in /home/myuser/.local/share/rhythmbox/plugins/, this is how it looks like for me:

~ $ ls ~/.local/share/rhythmbox/plugins
listenbrainz  listenbrainz.plugin

Then don’t forget to run

glib-compile-schemas $HOME/.local/share/rhythmbox/plugins/listenbrainz/schema

Start Rhythmbox from a terminal window to see if there is any error output.

I will also provide an installer script for easier installation.


#9

@outsidecontext

Thank you. Now I understand. I also want to note I’m using the version since the latest commit

I did that after applying your most recent suggestions.

I did that too. I just started the program just typing rhythmbox in a terminal, then I went to the plugin page and enabled the plugin and expected to see errors in the terminal but instead the gui let me click on settings(it didn’t let me before) and then it prompted me for the user token.

I don’t know why it worked now but I think your information that I should copy the files and not the extracted folder into $HOME/.local/share/rhythmbox/plugins/ helped me solve my issue. You don’t need to provide an installer for my sake but if you think it is important you are welcome to.


#10

OMG, this is amazing now both the artist and the recording are linkable and clickable links linking to the right places. :smiley:

Well done!

Its my first “listen” with “native ListenBrainz API” functionality and works for Rhythmbox too! I honestly didn’t think I’d ever be able to make this work. Thanks lots!

@outsidecontext
You don’t happen to accept donations in any kind of cryptocurrency?


#11

@internetofdata Thanks for the nice words and thanks for the offer, but no need for donations :slight_smile: Better donate to Metabrainz, I think they can make better us of this :wink:

I have pushed a small update so now it only scrobbles local music and no longer tries to scrobble streams and podcasts. Although figuring out how to scrobble songs inside radio streams could be interesting, but the Last.fm scrobbler doesn’t do that either.

My actual goal is to have this submitted upstream to Rhythmbox as an included plugin. But developing this outside of Rhythmbox allows me to quickly get something usable out to users to gather feedback. I am actually quite happy with the current status, it seems stable and feature complete. I will let it get some testing by users and then prepare a patch for Rhythmbox.


#12

I tried with Rhythmbox 3.4.2. Put the contents (at least the listenbrainz folder and the listenbrainz.plugin file) directly in /home/myuser/.local/share/rhythmbox/plugins/, this is how it looks like for me:

~ $ ls ~/.local/share/rhythmbox/plugins
listenbrainz listenbrainz.plugin

Then don’t forget to run

glib-compile-schemas $HOME/.local/share/rhythmbox/plugins/listenbrainz/schema

Start Rhythmbox from a terminal window to see if there is any error output.

I will also provide an installer script for easier installation.

That still didn’t work for me, and (GNOME) Terminal says:
(rhythmbox:6578): Gtk-WARNING **: Failed to register client: GDBus.Error:org.gnome.SessionManager.AlreadyRegistered: Unable to register client

When I closed Rhythmbox, it also stated:
(rhythmbox:6578): Gtk-WARNING **: mnemonic "s" wasn't removed for widget (0x565524ac27f0)


#13

I don’t think those warning messages are in any way related to the plugin. Just to make sure you have everything correct, can you check that:

  1. You have placed the plugin in $HOME/.local/share/rhythmbox/plugins thus that there is a file listenbrainz.plugin directly in this directory and also a folder listenbrainz containing the .py files and a sudirectory schema
  2. You are using the latest version from https://github.com/phw/rhythmbox-plugin-listenbrainz/tree/master/listenbrainz
  3. You have run glib-compile-schemas $HOME/.local/share/rhythmbox/plugins/listenbrainz/schema and there were no error messages
  4. You can see the listenbrainz plugin in the Rhythmbox plugin list
  5. You have actually activated the plugin

#14
  1. Yep, my setup is the same.
  2. Unless you added a new version in the last 3-ish hours, it’s the latest version I am running.
  3. Yep - no errors… All it did was accept the command and show a new line.
  4. I can “see” the ListenBrainz plugin, it has a “tick” in the box and I can even click “About” - but I cannot click “Preferences”.
  5. See above.

By the way, I’m using Rhythmbox 3.4.1 under Pop!_OS 17.10 (which is based on Ubuntu 17.10).


#15

I can kind of replicate your issue if I place the listenbrainz.plugin file in ~/.local/share/rhythmbox/plugins/listenbrainz instead of ~/.local/share/rhythmbox/plugins

You had installed the plugin pretty early after I posted it on the bug tracker. Initial versions had a slightly different file layout, maybe there are some left over files? Maybe try removing the ~/.local/share/rhythmbox/plugins/listenbrainz folder completely and reinstall the plugin.


#16

You might have been right about something left over causing the problem - I manually deleted all of the contents of the “plugins” folder (rather than just pasting the new files over the top) and then re-installed the ListenBrainz plugin as per the above… Worked liked a charm!

Thanks! :wink:


#17

Well, it seems to be working perfectly now… And “listens” seem to be added to ListenBrainz surprisingly quickly.

I guess if I had to pick something to criticize, it would be that this plug-in would not be immediately obvious to users of Rhythmbox (assuming it was pre-installed - see below), because unlike Libre.fm/Last.fm, there’s no icon on the left of Rhythmbox.

Also, I’d love to either see this plug-in included with Rhythmbox by default or the functionality behind this plugin added to Rhythmbox (i.e. so that the functionality is supported natively)…


#18

Lollypop 0.9.401 is now available as the latest release, and it includes the ListenBrainz support!