[vlc-devel] [PATCH] Make VLC scrobble through the Official client if possible.

Jean-Baptiste Kempf jb at videolan.org
Wed Jul 2 09:02:01 CEST 2008

Hello peter,

On Tue, Jul 01, 2008 at 05:59:53PM +0100, Peter Grundström wrote :
> my name is Peter Grundström and I work on the Last.fm Client Team. VLC
> already have support for scrobbling (The act of reporting to Last.fm what
> you just listen to) but this is by using our webservices directly. This
Thanks for the patch

> patch also adds support for scrobbling via the official client, if
> available. This have some advantages like having more information about the
> track in the Last.fm client and also have access the socialnetwork aspects.
I doubt that this will enter the codebase for 0.9.0, but for 0.9.1, this
seems ok.

> I was a bit uncertain if to make this a whole new module but I chose to
> integrate it in the existing. Please tell me if you would like it the other
> way around.
I think this is ok the way you designed it.

> When this patch is applied the audioscrobbler module will try to scrobble
> through the client if possible. This works by opening a socket to the
> Last.fm client and the sending commands over it. If it fails it will revert
> to use the webservices directly. The only time you will lose scrobbles is if
> you start playing a track while the Last.fm client is running and the close
> it before the you reach the scrobblepoint ( 4 min or middle of the track ).
> This is as far as I can see impossible to fix since we cant know when the
> Last.fm client closes and if we scrobble the same track twice we will
> trigger spam protection.
Thanks for the explanations.

> Here are some comments on the changes I made:
> > -        a = encode_URI_component( psz_meta ); \
> > +        a = strdup( psz_meta ); \
> The audioscrobbler module earlier stored the metadata of the track in
> percent encoding. This is the right format when sending it to the
> webservice, but wont work when sending it through the socket to the client.
> I changed it to store the metadata unencoded and then encode it before it
> sends it to the webservice or through the socket.
> > input_item_GetURL( p_item );
> One of the problems I had was not being able to get a hold of the path of
> the current file. Is the above function the one I'm supposed to use.
It should be.

> Another one was that when the VLC is closed I need to send the stop command
> to Last.fm. I tried sending the command in several places Close, Unload and
> Run (audioscrobbler is dying part...). But every time the thread gets killed
> before the Last.fm client has time to read from the other end of the socket.
> Please advise.
funman, advise on this ?

> While doing this I also found a bug in the old code (still present). If you
> enable scrobbling and then dont enter a username and password, the client
> will crash when trying to scrobble via the webservice.
This needs fixing ASAP.

> j-b: The thing we talked about regarding the Pvlc flag in the call to the
> webservice. I talked to max about it and it's not necessary but if you do we
> can give you statistics over how many scrobbles made from VLC.
I think we would want that.


More information about the vlc-devel mailing list