Thursday, January 21, 2010

Rhythmbox plugin - Syncing with

In my quest to manage my music collection seamlessly between media players, I've decided to use Last.Fm as my main database. Last.Fm provides ways to store:

  • History of played tracks
  • Playcount associated with played tracks
  • Tags associated with tracks
  • Playlists
  • etc.
Through their API (see mindmap), it is possible to have access to all this information (and much more).

My music collection is currently organized through Rhythmbox - it wasn't my first choice at the time I've moved from my Windows desktop to my Linux Ubuntu one but it has proven very useful. RB can be extended with Python scripts quite painlessly.
Last.Fm Syncing
The plugin I have developed this time supports the following features:
  • When a track is played, it downloads the corresponding information from the user's Last.Fm account and updates the following fields of the Rhythmbox database:
    • Playcount: if the " playcount" associated with the track is greater than 0, the local playcount of RB is updated with it
    • Rating: if the " love" field is set for the track, the local "rating" field of the track is set to 5.0 (5 stars)
With this functionality, it is easier to update a local Rhythmbox media player database with information stored on a user's account on  The standard Last.Fm plugin of Rhythmbox must be enabled and configured correctly.
The plugin can be installed by following the procedure found at the project's home page. A direct link to the plugin Debian/Ubuntu repository is provided here.
The project is far from being completed - I have many other features in the pipeline. Stay tuned!
Related project
There is a related project to this one: Rhythmbox - Last.Fm Desktop Client plugin.

Feedback is very welcome!

UPDATE: see here for details on the new release.


  1. Hello, I just download your plugin and it's working very well.

    One request though, is it possible to update the whole library (with a manual scan are something like that).

    As I have a big library to update, I'd prefer to have it update in one time.

    Thank you for this first version of the plugin.

  2. @Vincent: I'll certainly provide this sort of feature when I get around to finding time. I am pretty sure this feature would move up my priority list the next time Rhythmbox "eats" my database file ;-) Kidding aside, it is already on my long list of todo. Thanks for your interest.

  3. This is absolutely wonderful. I wanted to do something similar to this once, but due to lack of time I haven't begun developing it. Thanks for this :)

  4. By the way: I just noticed there are no packages for Ubuntu Lucid in your PPA yet. Could you be so kind to enable the checkbox that adds them too? Thanks :)

  5. @Bram Bonné: Glad you like it!

    I am working on a major update to this plugin. I probably won't issue a Lucid release before the next release (FYI, releasing a package for a new distribution isn't just "enabling a checkbox" unfortunately). Stay tuned!

  6. Oops, I thought these PPA's did all kinds of things to automagically make things compile in different architectures :-)
    Other Lucid users: the Karmic packages work just fine in Lucid. To install, just add

    deb karmic main
    deb-src karmic main

    to your /etc/apt/sources.list, and import the PPA's key.

    Great to hear you're actively developing this. Maybe I could offer some help after my exams. Which reminds me: got to get back to work now!

  7. @Bram Bonné: a PPA (1) builds the .deb based on the .diff provided (2) hosts the .deb in an 'apt' compatible channel. The process (1) basically just makes sure that the package builds correctly for a specific Ubuntu release. For this, the .diff provided must be crafted to work against the specific Ubuntu release.

  8. Hi,

    I noticed you added a Lucid PPA with your last update :-) However, I think you forgot something when creating it, since I am not able to enable the plugin anymore after installing the Lucid version.

    The exception Python is throwing is this:

    Traceback (most recent call last):
    File "/usr/lib/rhythmbox/plugins/synclastfm/", line 46, in
    from system.mbus import Bus
    ImportError: No module named system.mbus

    (rhythmbox:3555): Rhythmbox-WARNING **: Could not load plugin synclastfm

    Thanks again for your wonderful work on this plugin :-)

  9. I just tested the Karmic version, too, which seems to give me the same problem.

    Is there a place where I best submit bug reports? I feel guilty polluting the comments on your blog like this ;-)

  10. @Bram Bonné: could you try v2.01 to see if it helps?

  11. It still seems to fail with the same error.

    Traceback (most recent call last):
    File "/usr/lib/rhythmbox/plugins/synclastfm/", line 52, in
    from system.mbus import Bus
    ImportError: No module named system.mbus

    bram@brampc:~$ apt-cache policy rbsynclastfm
    Geïnstalleerd: 2.01-1jldupont1~lucid1
    Kandidaat: 2.01-1jldupont1~lucid1
    *** 2.01-1jldupont1~lucid1 0
    100 /var/lib/dpkg/status
    2.0-1jldupont1~lucid1 0
    500 lucid/main Packages

  12. @Bram Bonné: sorry, I meant v2.02... I corrected a packaging error and now it works on my end just fine.

    Issue tracking: please use

  13. @Bram: to be frank, I haven't tested this on Lucid yet... works fine on my Karmic install. Please use the Google Wave I have setup to continue this discussion:

  14. I'm afraid I can't access that Wave. It says: "You are not a participant in this Wave".
    Anyway, I will look into it in a week, when I finished my last exam :-)

  15. @Bram Bonné: first time I have attempted to make a Wave public... now it should be public: try it again at your leisure.