: Last.fm integration

Martin Aumueller aumueller at uni-koeln.de
Fri Jun 23 19:00:49 UTC 2006


Hi,

there is already code that does exactly what you want for iPods. So, the hard 
part of submitting to last.fm is getting the necessary information from your 
device. As the current implementation disregards play times (as iPods only 
store the last play time of a song, it's just implemented for improving play 
counts), you only have to know how many times a track has been played. Amarok 
will then make up a play time where it didn't play a song itself and try to 
submit your songs.

To make it work, you just have to override the recentlyPlayed() method of your 
MediaItem to return the number of times this item was played since the last 
sync.

Martin

On Fri June 23 2006 17:09, Colin Guthrie wrote:
> Joel Wiramu Pauling wrote:
> > On Friday 23 June 2006 18:57, Bart Cerneels wrote:
> >> How feasible do you think something like that is? And how much code have
> >> you written? Cause I want to try getting statistics from rockbox, not
> >> just for audioscrobbler but for the statistics in the Amarok db. Could
> >> be a feature of a rockbox specific mediadevice plugin.
> >
> > Very feasible,
> >
> > There are a number of threads and pages on collection harvesting from
> > rockbox.
> >
> > I have done very little, and nothing since the media device change over
> > in amarok.
> >
> > But if nothing re submission system for last.fm has changed... then it's
> > just a matter of appending some lines of xml to the amarok file that sits
> > in .kde/share/amarok and contains the unsubmitted last.fm tracks on mount
> > (might want to do some sanity testing as well making this a bit more
> > complicated...)
> >
> > Rockbox side, harvesting LOTS of stats would probably not be nice, plus I
> > have a feeling that some of the platforms rockbox runs on don't have good
> > clocks, which is the only major problem.
> >
> > But just writting artist/track tags out and a playtime to a file would
> > not be a huge issue.
> >
> > You would have to consider battery drain etc if you are doing lots of
> > writes to the disc. It might be better to keep the history in memory and
> > write it to disc on poweroff/mode change, rather than writting/updating a
> > file each track change.
> >
> > These were my inital observations. In terms of code, I have done squat.
> > As I said I don't have a test platform and the emulator is a pain to
> > setup on amd64 for rockbox.
>
> This all sounds very interesting. I think the clock thing can hopefully
> be worked around (perhaps some form of clock offset correction system
> when you plug your device in - remembering when the clock was last sync
> and using a fairly simple averaging algorithm to update the recorded
> times of played songs?).
>
> I would be very keen on this overall, and would especially like to see
> integrated support for the tag databases format for rockbox in Amarok.
>
> I don't think the battery drain of writing the stats would be too great
> and it is probably easy enough to keep a limited number in memory and
> only write it to disk when it is spinning already.
>
> I've nto really got time to help on this just now but perhaps towards
> the middle/end of summer I'll be able to help out.
>
> Col.
>
> _______________________________________________
> Amarok mailing list
> Amarok at kde.org
> https://mail.kde.org/mailman/listinfo/amarok



More information about the Amarok mailing list