nightingale-media-player / nightingale-hacking

Working tree for the community fork of Songbird, Nightingale. If building, use the sb-trunk-oldxul (development) branch, with the tag 1.12.1 tag for stable, for now. The master-xul-9.0.1 branch is the current progress in building Nightingale with XULRunner 9 and builds, but is broken. All help in terms of patches and pull requests is welcome.
https://getnightingale.com
GNU General Public License v2.0
185 stars 41 forks source link

Last.fm add-on scrobbling issue #191

Open dyedfox opened 11 years ago

dyedfox commented 11 years ago

Approximately, every second track (or even more rare) on Nightingale 1.12 is not scrobbled with last.fm.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/783113-last-fm-add-on-scrobbling-issue?utm_campaign=plugin&utm_content=tracker%2F230233&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F230233&utm_medium=issues&utm_source=github).
rsjtdrjgfuzkfg commented 11 years ago

Is this related with the playcount update issue (#142)? Does the scrobbling corelate with the playcount updating?

freaktechnik commented 11 years ago

If it wasn't related to #142 it should be fixed with #222.

rsjtdrjgfuzkfg commented 11 years ago

@freaktechnik I'd propose we close this one then, or do we have someone able to test it?

freaktechnik commented 11 years ago

Hm, I can check if I can reproduce the issue with an "old" last.fm extension and the current release and if yes, check if it's gone with a nightly or the updated extension.

chocolateboy commented 11 years ago

222 doesn't fix this, unfortunately. I still regularly lose scrobbles with that fix in 1.12. In my case, the problem seems to occur when Spotify scrobbles are interleaved with Nightingale scrobbles. The deprecated last.fm API (1.2.1) used by the Nightingale addon seems to expect a session key per-user but assigns a session key per-login. This causes both Spotify and Nightingale to get "BADSESSION" errors, though the Spotify client seems to recover/re-authenticate more reliably than this addon.

BADSESSION This indicates that the Session ID sent was somehow invalid, possibly because another client has performed a handshake for this user. On receiving this, the client should re-handshake with the server before continuing.

There may be fixes that can be applied to improve the last.fm addon's retry handling, if it's not fixed by #142, but IMO a better long-term solution would be to rewrite the addon (or create a new one) to use the latest last.fm API via one of the several last.fm modules now available on npm. Almost all of the code in the current addon is related to the protocol handling, and large chunks of it are related to the radio feature. A much simpler, more maintainable addon could be written if the radio stuff was jettisoned (or moved to a separate addon) and the scrobbling was delegated to a third-party module.

freaktechnik commented 11 years ago

Yeah, I at least will not spend time trying to fix the current last.fm extension. However upgrading the APi is something we'll have to look into soon.

freaktechnik commented 9 years ago

We are still using the ancient "post" API. Since I've already looked into the code for the login I'll also upgrade the scrobbling part to the RESTful API.

freaktechnik commented 9 years ago

I hope this is fixed with http://wiki.getnightingale.com/lib/exe/fetch.php?media=audioscrobbler-1.0.12.992ecebdf9.xpi

Scrobbling might still be a bit wonky (I don't think we clean up properly when shutting down), but at least the problems with spotify and similar should be gone.

tobek commented 9 years ago

I came across this because scrobbling wasn't working for me at all (wouldn't log in) but I downloaded this new version of the add-on and it's working now, so thanks!

Will update if I find it misses some tracks.

LolaMan commented 9 years ago

Its not scrobbling tracks at all for me

freaktechnik commented 9 years ago

@LolaMan have downloaded the updated version and logged in again?

dyedfox commented 9 years ago

I experience the same problem. Extension does not scrobble tracks (Nightingale 1.12.1). I don't understand.

freaktechnik commented 9 years ago

@dyedfox Have you updated to the version linked above and logged in again?

dyedfox commented 9 years ago

Sure.

freaktechnik commented 9 years ago

Have you played longer sequences of tracks (>5 minutes)? Because the extension doesn't always immediately try to scrobble tracks after they were played. Further it seems that last.fm rejects scrobbles of tracks it doesn't know, that's at least what I've found in my testing so far.

dyedfox commented 9 years ago

Yeah, I've been testing extension half a day.

freaktechnik commented 9 years ago

Hm, so Now Playing ("Scrobbling Now" on your profile) and scrobbling itself don't work? (-> see http://www.last.fm/user/freaktechnik)

EDIT: oh, empty artist fields might be an issue. (Last.fm needs a title and artist for scrobbles) EDIT2: Yeah... empty artist fields are aproblem...

freaktechnik commented 9 years ago

Sooooo. Only random tracks were scrobbled until now. This will now not scrobble the random tracks that got scrobbled with this version. Some logic was inverted that lead to most scrobbles not getting through. You can download a fixed version from http://addon-files.getnightingale.com/xpis/audioscrobbler-1.0.13.dd27027fa1.xpi

If any new real deal breakers come up I won't be able to deal with the over the weekend - sorry.

tobek commented 9 years ago

The latest version won't install for me - error (unexpected installation -203) says to check console but I tried it with console open and nothing:

screen shot 2015-08-28 at 12 06 00 pm

No rush to fix though, thanks for working on it!

LolaMan commented 9 years ago

Same here. Its not installing

rsjtdrjgfuzkfg commented 9 years ago

@tobek @LolaMan installing works for me (in a rather old trunk build), maybe you did not use a trunk version? The version posted is not compatible with the current release.

LolaMan commented 9 years ago

Oh that must be why. What version do you recommend?

rsjtdrjgfuzkfg commented 9 years ago

I'd just build the current trunk, enabling building add-ons should include @freaktechnik 's latest changes to the last.fm as well: https://github.com/nightingale-media-player/nightingale-hacking/commit/dd27027fa1a8f655087c45dc1989537be4a6e535

If you're not into building or on windows (in that case, building is a pain to set up), take the latest nightly for your platform (I have the feeling they are quite old for most platforms, though).

freaktechnik commented 9 years ago

I've updated the version there to be compatible with Nightingale 1.12.1. Sorry, forgot to adjust the compatibility string.

LolaMan commented 9 years ago

Now it installed. Its scrobbling now but as you mentioned somewhere you may have to wait for the scrobble to show up on your last.fm page

dyedfox commented 9 years ago

Installing works for me. Now testing.

dyedfox commented 9 years ago

Everything works. Thank you very much!

dyedfox commented 9 years ago

Unfortunately, the extension misses some tracks again....

freaktechnik commented 9 years ago

Yes it misses some tracks in the following three cases:

LolaMan commented 9 years ago

Same problem it misses some tracks.

LolaMan commented 9 years ago

Sorry for double post. Any update or news on this?

freaktechnik commented 9 years ago

The three issues listed above still apply. Two of them have to be fixed within Nightingale (I'm not sure as to how far we can actually fix them....) and would require you to update Nightingale.

dyedfox commented 9 years ago

No other choice but to use native last.fm scrobbler from here http://www.last.fm/en/download in combination with Last.fm Scrobbling Support extension. http://wiki.getnightingale.com/doku.php?id=add-ons#lastfm_scrobbling_support (you may need to change maxVersion in install.rdf).

Verti9o commented 8 years ago

I have two setups with different version. 1.0.11 scrobbles every track flawlessly, but it cannot log in. On the other side 1.0.12/13 logs in anytime, but scrobbles a track occasionally.

zjays commented 8 years ago

@Verti9o for 1.0.11, how can you scrobble tracks if it won't log in?

Verti9o commented 8 years ago

@zjays I have a system with the old version. It was never updated or logged out for years and it still scrobbles.

zjays commented 8 years ago

Ah ok, I guess the old scrobbling API still works then. So for now, I just updated 1.0.11 only to include freaktechnik's login fix (plus the updated Last.fm logo). I can login with it and it seems to be scrobbling well for me, although the Love track button doesn't work.

I added it to the add-on page: http://wiki.getnightingale.com/lib/exe/fetch.php?media=addons:audioscrobbler-1.0.11.2454.1-loginfix.xpi

zjays commented 8 years ago

I guess it's better to use http://wiki.getnightingale.com/doku.php?id=add-ons#lastfm_scrobbling_support together with the official Last.fm scrobber, assuming that works on the user's system. If the scrobbling issues using the RESTful API can't be solved, maybe this add-on should be bundled with the next release of Nightingale.