[Rhythmbox-devel] [WIP] Rhythmbox-Spotify Plugin Revived

Hi All,

As most of you are aware, the Rhythmbox and larger GNOME platform APIs
have been in flux for the past few years. This has caused a number of
plugins to suffer from bitrot, particularly "out-of-tree" plugins.

There was one plugin in particular that interested me,
"rhythmbox-spotify", which I've now tackled, and it is working at
alpha quality on Rhythmbox 2.98. A bit of history of this plugin:

 (1) It seems to be based on the DAAP plugin in terms of code layout
and some of the boilerplate stuff, so Paolo Maggi's works are all
 (2) The original author of the rhythmbox-spotify project seems to be
Ivan Kelly (please correct me if I'm wrong). This work was maintained
through 2009, from what I can tell of the github commit history.
 (3) Alexandre Mazari made some updates to the APIs in early 2011, but
unfortunately did not complete the transition to the Gnome 3.0
platform. There have also been more drastic changes in Rhythmbox's own
APIs since then.

The work performed so far is as follows:

 - Ported from RBPlugin architecture to libpeas.
 - Ported prefs UI from GTK2/Glade3 to GTK3 (no Glade).
 - Fixed a _really_ nasty synchronization issue that was crashing in
libspotify (see the commit log for details [2]).
 - Fixed internationalization, removed a ton of unneeded files, and
other little maintenance tasks. Also cleaned up source formatting
using Eclipse to Allman/BSD style across all source files.
 - Made the plugin fully compatible with the latest version of
libspotify as of this writing (12.1.51).
 - Hacked on the build system to freshen up the autotools files.
 - Silenced a number of warnings (whether they were there before the
API changes or not, I don't know).

At the present time, I've brought up the plugin so that it plays
tracks when searching in the "spotify" store plugin. The known issues
are many:

 (i) You have to search twice in order to get results at present; I am
investigating this. The source will appear to have no tracks until you
have edited your search query at least twice, at which time it starts
to return results (if there are any in Spotify). Try searching for the
last name of a popular music artist to get started.
 (ii) The audio starts to pop every few seconds near the end of a track.
 (iii) The plugin is still using GConf-2.0 for settings. I'm familiar
with GSettings, but haven't had time to port it over yet, as I was
focused on the core functionality.
 (iv) The elapsed time and total song duration times are not always
accurate: sometimes the slider doesn't update at all, and sometimes
the slider indicates a negative time when it should be positive.
 (v) The active track will change before the song is finished playing.
When this happens, the buffered audio of the previous track will
continue to play, even though the UI thinks it's on the next track.
 (vi) An error dialog telling you you've got a wrong password will
display when you enable the plugin, until you are able to successfully
authenticate a username/password using the Preferences pane.
 (vii) SECURITY: The plugin stores your Spotify password in clear text
in GConf (soon to be GSettings). This will be easy to workaround
because libspotify itself provides a "blob" (essentially an
authentication token) that the application can use to re-authenticate,
without having to save the user's password in text form.
 (viii) I consider this to be a "bug" but some may not: this plugin
depends on the proprietary libspotify, which is not strictly
necessary; the despotify library should work as well, and is open
 (ix) No support for using your Spotify playlists, though I'm sure
this will be a very important feature to provide.

I'll also mention that upstream Rhythmbox bug #677665 [5] is a pain
for most/all native out-of-tree plugins right now, and as a result,
you will get FTBTS unless you apply the obvious fix to the problem
detailed in that bug.

Even if I could resolve all of the known issues, I am unlikely to seek
upstreaming of this plugin (I wouldn't be opposed if the RB
maintainers wanted to pick it up, though!). I think it will be happy
as an out-of-tree plugin, and I will continue to maintain it and
whittle down the list of bugs. If anyone has a burning desire to see
this included in your distro of choice (but not before the security
issue is fixed, at a minimum), let me know.

Now that I understand the plugin well enough to have fixed large parts
of it to work with a new platform, I might as well go ahead and
re-write it in Vala. I already maintain one out-of-tree Vala plugin,
so two shouldn't be any harder. I can't wait to shove all of that GLib
boilerplate stuff under the hood. ;-)

Anyway, this is just kind of a "work log" of what I've done with this
crusty old code to make it, at least, play some music from Spotify on
the Gnome3 platform and the latest libspotify. If anyone is interested
in contributing, I'd be more than happy to work together. From this
point forward, I'd like to focus on resolving as many user-visible
bugs as possible, while also making sure we're using all the latest
APIs (GSettings, hint hint) and improving code readability and
maintainability. I haven't gone whole-house into a Vala re-write yet
because I'm still learning how it works, but that's on my longer-term
todo list.

I'll end with a few links:

[1] My first Rhythmbox plugin, written in Vala; rbpitch:
[2] The Rhythmbox-Spotify code that I've revived:
[3] Alexandre's vintage 2011 code, which, while newer than Ivan's, is
still a long way from working with Rhythmbox 2.98:
[4] Ivan's original code, where it all started AFAICT:
[5] Gnome Bug 677665: https://bugzilla.gnome.org/show_bug.cgi?id=677665

I idle on Gnome IRC in #rhythmbox as allquixotic; feel free to ping me
(though I may not answer for some time).



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]