Bug 320219 - last.fm scrobbles show as "now playing" but not actually scrobbled
Summary: last.fm scrobbles show as "now playing" but not actually scrobbled
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Services/Last.fm (show other bugs)
Version: 2.7.1
Platform: Arch Linux Linux
: NOR major
Target Milestone: 2.8
Assignee: Amarok Developers
URL:
Keywords:
: 320340 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-05-24 15:00 UTC by Daniel Cohen
Modified: 2013-09-14 23:22 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.8


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Cohen 2013-05-24 15:00:28 UTC
Scrobbling in last.fm shows up on profile page as "now playing", but when the next song starts playing it replaces the previous - so no song is actually scrobbled.

Some of the time after a random amount of time the whole slew of songs will appear (but not always).

It's definitely a liblastfm/amarok problem and not lastfm itself because it works just fine in other players.

Reproducible: Always

Steps to Reproduce:
1. scrobble song 1
2. scrobble song 2

Actual Results:  
song 1 is not in play history

Expected Results:  
song 1 should be in play history
Comment 1 David Walser 2013-05-24 15:26:09 UTC
I can confirm this and I have more information.

I can reproduce this with Amarok 2.7.0 and 2.7.1, but the problem does depend on the liblastfm version.  With liblastfm 1.0.6 and prior versions, this works fine.  This bug occurs when you update to liblastfm 1.0.7.

I looked at the diff between 1.0.6 and 1.0.7 and it appears most of the changes involve proxy support, and I do have http_proxy environment variables set, I haven't tested without those.

I reported this to the upstream liblastfm developer (Michael Coffey a.k.a. eartle), and he had this to say of the changes in 1.0.7:
"I expect this is because we've separated cache() and submit(). When you call cache() we add the track to a list of scrobbles and store it to file so that it persists between sessions. submit() will actually submit the scrobbles in the cache to Last.fm. Up to version 1.0.6 we were calling submit() inside cache() so we always tried to submit as soon as you had cached a track. We now rely on the user calling submit() separately so you can cache tracks as soon as they hit the scrobble point, but then wait until the track finishes to submit the scrobble.

I realise that this is a behaviour break from early versions of the 1.x.x library, but it was to fix a display bug on the website and I was hoping it wouldn't affect too many people. This is however reverting to the 0.x.x behaviour of the library. "
Comment 2 Mark Kretschmann 2013-05-24 17:22:29 UTC
@David: Big thanks for the information. We're going to fix it.
Comment 3 Matěj Laitl 2013-05-25 09:02:25 UTC
(In reply to comment #1)
> I reported this to the upstream liblastfm developer (Michael Coffey a.k.a.
> eartle), and he had this to say of the changes in 1.0.7:
> "I expect this is because we've separated cache() and submit(). When you
> call cache() we add the track to a list of scrobbles and store it to file so
> that it persists between sessions. submit() will actually submit the
> scrobbles in the cache to Last.fm. Up to version 1.0.6 we were calling
> submit() inside cache() so we always tried to submit as soon as you had
> cached a track. We now rely on the user calling submit() separately so you
> can cache tracks as soon as they hit the scrobble point, but then wait until
> the track finishes to submit the scrobble.

Oh I see, I'll adapt Amarok code to call submit explicitly, no problem, however it will only be available starting with Amarok 2.8 (or git users).

Can you please point me to where you've reported this to upstream?
Comment 4 David Walser 2013-05-25 10:14:19 UTC
(In reply to comment #3)
> Oh I see, I'll adapt Amarok code to call submit explicitly, no problem,
> however it will only be available starting with Amarok 2.8 (or git users).

Yes of course, but please post a link to the git commit here in this bug.

> Can you please point me to where you've reported this to upstream?

I e-mailed him at michaelc@last.fm
Comment 5 Daniel Cohen 2013-05-25 12:43:22 UTC
So is the current workaround to downgrade to 1.0.6 until amarok 2.8 is released?
Comment 6 Matěj Laitl 2013-05-25 18:46:16 UTC
Git commit c534a8d964b680cda6dc894e0b81f400556d2a4e by Matěj Laitl.
Committed on 25/05/2013 at 20:39.
Pushed by laitl into branch 'master'.

ScrobblerAdapter: call submit() explicitly

BUGFIXES:
 * Prevent Last.fm scrobbles not being submitted until restart due to
   change in liblastfm 1.0.7.

Thanks to David Walser for debugging this with liblastfm author Michael
Coffey.

Work-around for Amarok <= 2.7.1 is to use liblastfm <= 1.0.6.
FIXED-IN: 2.8
CCMAIL: Michael Coffey <michaelc@last.fm>

M  +2    -0    ChangeLog
M  +2    -1    src/services/lastfm/ScrobblerAdapter.cpp

http://commits.kde.org/amarok/c534a8d964b680cda6dc894e0b81f400556d2a4e
Comment 7 Matěj Laitl 2013-05-27 09:26:40 UTC
*** Bug 320340 has been marked as a duplicate of this bug. ***
Comment 8 Daniel Duris 2013-09-14 21:53:48 UTC
Hello,

this bug reappares in Amarok 2.8.0 on Precise. Song is shown as "now playing", but never gets to the recently played list.
Comment 9 Matěj Laitl 2013-09-14 21:57:32 UTC
(In reply to comment #8)
> Hello,
> 
> this bug reappares in Amarok 2.8.0 on Precise. Song is shown as "now
> playing", but never gets to the recently played list.

Oh, really? Note that the Last.fm site may have lags or caching problems, please give it up to one day to show the play, also please check the http://www.last.fm/user/<username>/tracks in addition to the profile page.
Comment 10 Daniel Duris 2013-09-14 22:05:37 UTC
Yes, really, please stop patronizing. Tracks were displaying correctly yesterday, after some KDE update (Amarok etc.), this problem has appeared.
Comment 11 David Walser 2013-09-14 22:06:34 UTC
This bug has not reappeared.  I don't use Ubuntu, but I am running Amarok 2.8.0 with the latest liblastfm (1.0.8) and it works fine.
Comment 12 Daniel Duris 2013-09-14 22:09:11 UTC
Well, so? Maybe the problem is on Ubuntu (12.04)
Comment 13 David Walser 2013-09-14 22:11:26 UTC
So, this bug does not exist upstream.  It has definitively been fixed.  If an Ubuntu update broke something, please report it to them.
Comment 14 Daniel Duris 2013-09-14 22:13:42 UTC
OK, will do.
Comment 15 Matěj Laitl 2013-09-14 22:15:01 UTC
Some useful info can be gained from Amarok running amarok from console as: amarok --debug --nofork    (it prints the message set to last.fm and the response, watch it after and of track playback). You may also tap Amarok communication with last.fm servers using Wireshark.
Comment 16 Janet 2013-09-14 23:22:00 UTC
(In reply to comment #8)
> Hello,
> 
> this bug reappares in Amarok 2.8.0 on Precise. Song is shown as "now
> playing", but never gets to the recently played list.

You have installed Amarok via the backports PPA? The backports PPA does not contain liblastfm1, so I guess it is a mismatch between a current Amarok version and an old liblastfm.