Thursday, January 21, 2010

Rhythmbox plugin - Syncing with Last.fm

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).

Rhythmbox 
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 "last.fm playcount" associated with the track is greater than 0, the local playcount of RB is updated with it
    • Rating: if the "last.fm 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 Last.fm.  The standard Last.Fm plugin of Rhythmbox must be enabled and configured correctly.
Installation
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.
Future
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.

15 comments:

  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.

    ReplyDelete
  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.

    ReplyDelete
  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 :)

    ReplyDelete
  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 :)

    ReplyDelete
  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!

    ReplyDelete
  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 http://ppa.launchpad.net/jldupont/jldupont/ubuntu karmic main
    deb-src http://ppa.launchpad.net/jldupont/jldupont/ubuntu 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!

    ReplyDelete
  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.

    ReplyDelete
  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/__init__.py", 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 :-)

    ReplyDelete
  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 ;-)

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

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

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

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

    ReplyDelete
  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 http://github.com/jldupont/rb_synclastfm/issues

    ReplyDelete
  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: https://wave.google.com/wave/waveref/googlewave.com/w+sTCHIODhA

    ReplyDelete
  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 :-)

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

    ReplyDelete