last.fm loses currently playing song?

Artist radio, genre radio & related artists. A Subsonic server for music nerds.

Moderator: moderators

last.fm loses currently playing song?

Postby equanimity » Tue Feb 19, 2013 9:03 pm

Apologies if this is either a well-known issue, or a non-musicCabinet issue, or both. I did not notice it before in SubSonic, but I only used it for a day or two.

The issue is that when a new song starts playing, the last.fm recently played list correctly updates to:
Current Song (now playing)
Previous Song (just listened)

but while the song is playing, last fm will "lose" the currently playing track, and revert back to just showing
Previous Song (just listened)

After a couple of minutes (or when the next track starts), the missing track will reappear. So at the end of a playlist of 10 songs, all 10 will be correctly scrobbled, but the "now playing" item is missing a lot of the time.

Is there a way to fix this?

Thanks in advance.
equanimity
 
Posts: 12
Joined: Tue Feb 19, 2013 8:42 pm

Re: last.fm loses currently playing song?

Postby hakko » Tue Feb 19, 2013 9:37 pm

From what I've learned so far, this is a last.fm issue.

Subsonic scrobbles songs to last.fm the very second you start listening to it. This is pretty annoying if you're skipping through a random playlist (and you want correct last.fm stats).

I rewrote this in MusicCabinet so that when you start listening to a song, a "Now playing" update is sent to last.fm. Not until 80% of the track has been played uninterrupted (and some extra rules for short songs etc), a scrobble is sent to last.fm. This makes for much more accurate stats.

I've tried sending continuous "Now playing" updates to last.fm to have the song constantly displayed while you're listening to it, but with no effect. Since the stats actually get correct, I've left it the way it is with just one "Now playing" update and then one scrobble.

If anyone else have used the last.fm API and found a better solution for this, feel free to post here.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: last.fm loses currently playing song?

Postby equanimity » Wed Feb 20, 2013 7:56 am

Hi Hakko,

Thanks, that is very clear.

My use case is that I use the first item on this list (via recenttracks.txt) to display the currently playing track on my desktop, since this works across any player I use.

I am not sure what the trick might be with the API calls to scrobble / updatenowplaying, but I offer 2 thoughts:
- could it be that track.updateNowPlaying.duration is somehow not being set or is corrupted so until the scrobble happens the track is removed?
- clementine has worked around this somehow. They have the expected behaviour that each track is "now playing" / never scrobbled if it is skipped near the start (I tested 5, 25 and 50 seconds) but is scrobbled if skipped near the end (2:00 of a 2:40 song, without seeking).

I will look into it more and let you know. Thanks again,
equanimity
 
Posts: 12
Joined: Tue Feb 19, 2013 8:42 pm

Re: last.fm loses currently playing song?

Postby hakko » Fri Feb 22, 2013 3:56 pm

I'm not sending duration for the updateNowPlaying call. I'll try that, thanks!
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: last.fm loses currently playing song?

Postby equanimity » Fri Feb 22, 2013 10:23 pm

Great! Duration does not seem to be well documented. For a small thing like this i wish i could have just submitted a patch to you, but since i couldn't, thanks for addressing it.
equanimity
 
Posts: 12
Joined: Tue Feb 19, 2013 8:42 pm

Re: last.fm loses currently playing song?

Postby hakko » Sun Mar 10, 2013 11:27 pm

Let's see if it works better from now on: viewtopic.php?f=4&t=9777&p=53923#p53923
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: last.fm loses currently playing song?

Postby flvinny521 » Mon Mar 11, 2013 5:22 pm

If I can piggyback on this thread, can I assume that the change in scrobbling that you implemented (80% of track elapsed vs. immediate) would carry over to playing through the official Android app or DSub?

I want to make sure that my skips don't get scrobbled.
flvinny521
 
Posts: 70
Joined: Thu Jul 28, 2011 1:48 pm

Re: last.fm loses currently playing song?

Postby hakko » Mon Mar 11, 2013 5:25 pm

It's generally better to start a new topic for new questions, it helps people searching for an answer to the same question!

But to answer, I think that scrobbling from apps is their own responsibility. The server doesn't know if the app is fetching a song to listen to it, or to cache it. It doesn't know if the app plays a cached song over and over etc. But I'm not a 100% sure on this.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: last.fm loses currently playing song?

Postby flvinny521 » Mon Mar 11, 2013 6:00 pm

Good point, thank you for the reply.
flvinny521
 
Posts: 70
Joined: Thu Jul 28, 2011 1:48 pm

Re: last.fm loses currently playing song?

Postby daneren2005 » Mon Mar 11, 2013 6:06 pm

1) It is the apps responsibility to scrobble AFAIK.
2) What I can remember of the way Subsonic/DSub handle it is that they scrobble when a song is "ended", regardless of whether or not it is done by reaching the end of the song or by skipping to the next song.
Developer of DSub for Android
daneren2005
 
Posts: 1709
Joined: Fri Jul 06, 2012 7:52 pm


Return to MusicCabinet

Who is online

Users browsing this forum: No registered users and 12 guests