After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 553433 - Last.fm plugin doesn't scrobble any songs.
Last.fm plugin doesn't scrobble any songs.
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Last.fm
1.3.1
Other Linux
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-09-23 17:51 UTC by kabbage1
Modified: 2010-08-05 20:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description kabbage1 2008-09-23 17:51:06 UTC
Says "Audioscrobbler upload failed - Plugin bug: Not all request variables are set - Invalid Timestamp".
Songs do occasionally show up as Now Playing, but they don't appear in the library later.
Comment 1 kabbage1 2008-09-23 18:52:40 UTC
Same on SVN.
Comment 2 Bertrand Lorentz 2008-09-24 21:02:28 UTC
Could you check the content of the following file :

~/.cache/banshee-1/extensions/last.fm/audioscrobbler-queue.xml

It contains the info for the tracks for which scrobbling has failed.

If it's not empty, you could try to remove it (backup first !), and see if that helps.
Comment 3 kabbage1 2008-09-25 15:07:31 UTC
(In reply to comment #2)
> Could you check the content of the following file :
> 
> ~/.cache/banshee-1/extensions/last.fm/audioscrobbler-queue.xml
> 
> It contains the info for the tracks for which scrobbling has failed.
> 
> If it's not empty, you could try to remove it (backup first !), and see if that
> helps.

Looks like that did the trick. Thank you!

I think the problem was that one of the queued tracks had negative start time. How can that happen?
Comment 4 kabbage1 2008-09-25 15:21:03 UTC
This is it:
    <QueuedTrack>
        <Artist>Modest Mouse</Artist>
        <Album>We Were Dead Before The Ship Even Sank</Album>
        <Title>Dashboard</Title>
        <TrackNumber>2</TrackNumber>
        <Duration>246</Duration>
        <StartTime>-62135596800</StartTime>
        <MusicBrainzId />
        <TrackAuth />
    </QueuedTrack>
-62135596800? Makes no sense at all.
Comment 5 Jakub 'Livio' Rusinek 2009-03-09 18:39:58 UTC
I had the same problem. First element in this file had StartTime with - at beginning. Something went wrong. But what? I'm not a fairy and I won't guess, I'll leave this for the developers ^^ .
Comment 6 Gabriel Burt 2009-10-27 20:17:49 UTC
Bulk changing the assignee to banshee-maint@gnome.bugs to make it easier for people to get updated on all banshee bugs by following that address.  It's usually quite apparent who is working on a given bug by the comments and/or patches attached.
Comment 7 Benjamin Podszun 2010-07-26 15:13:47 UTC
No patch so far, trying to wrap my head around getting started with the code.

Last.fm seems to require the unix timestamp (i.e. number of seconds since 1.1.1970) for the scrobble event. The sample value above corresponds (roughly, we're talking about local time not UTC as far as the code concerned) to -epoch on my machine (-62135600400).

Starting from there I assume the calculation for the timestamp is happening at least once with start_time uninitialized (ending up scrobbling at (DateTime)0 - epoch, result see above).

Since I'm new to the code this is pure theory so far, but one comment in the SongTimer class says roughly "number of events to ignore, since they can happen in wrong order". IF (big one) it is possible that someone tuning into last.fm, directly hitting skip after seeing the first title generates PlayerEvent.StartOfStream and PlayerEvent.EndOfStream and they end up being in wrong order the calculation would be off as described above.

Commits since this bug has been filed don't seem to address this problem.

Two ways to fix this in my very humble opinion: The quick one (initialize start_time to DateTime.Now, in a race the scrobbling event would be off a bit) or the long one (understand in which order the events can happen and if these FIXME comments in DateUtil need more work, going for the root of the problem).
Comment 8 Bertrand Lorentz 2010-08-05 20:42:39 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

I just committed a patch implementing the quick fix suggested by Benjamin :
http://git.gnome.org/browse/banshee/commit/?id=f8fd8b986339a09d6132219e8b1a2862247fd90d