Bug 5933 - AudioScrobbler settings reports '400 Bad Request'
: AudioScrobbler settings reports '400 Bad Request'
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Plugin
: 7.0
: PC Windows XP
: P2 major (vote)
: ---
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-27 04:16 UTC by Justin Fletcher
Modified: 2008-12-18 11:12 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Fletcher 2007-10-27 04:16:46 UTC
At svn 14144:

1. Go to the homepage.
2. Select Settings from the bottom right corner.
3. Click on 'Advanced' tab in the new window that appears.
4. Select 'Last.fm audioscrobbler' from the list on the left of the pane.
5. Enter your username and password.
6. Select Yes for both the options.
7. Click 'Save settings'.
8. Instead of saying 'Settings saved' at the top of the options, we now see '400 Bad request'.

(Marked major because the feature just doesn't work)
Comment 1 Justin Fletcher 2007-10-27 04:27:41 UTC
<laugh> It's an easy one.

The requests it's sending are logged as :

[12:21:03.5150] Slim::Networking::SimpleAsyncHTTP::onError (183) Failed to connect to http://post.audioscrobbler.com?hs=true&p=1.2&c=ss7&v=sc7.0&u=gclienttest&t=1193484063&a=2b2bbba21aba0fbc2ebaabd8287be2e8 (400 Bad Request)

After much checking of the parameters, I noticed what was wrong... the URL is incorrectly formed.
There's a missing / after the '.com'. It should be "....com/?hs=true...".

In Slim/Plugin/AudioScrobbler/Plugin.pm the line that defines the HANDSHAKE_URL should end in a /, not just a bare line.
Re-running the server with this change made appears to fix the problem.

However, it might also be advisable to update the error handling to report such 'hard failures' with a more friendly error message. ('Server could not be contacted or responded incorrectly' might be nicer than '400 Bad request', but probably still not friendly enough).
Comment 2 Chris Owens 2007-11-01 09:47:01 UTC
Andy notes the error message should probably note the server is not responding.  Perhaps we could also note that the user should check their uname and passwd while we're writing a more verbose error message.
Comment 3 Andy Grundman 2007-11-09 08:33:00 UTC
I added a better error message when it can't verify your account due to a Last.fm server problem.
Comment 4 Chris Owens 2008-03-07 09:03:20 UTC
This bug is being closed since it was resolved for a version which is now released!  Please download the new version of SqueezeCenter (formerly SlimServer) at http://www.slimdevices.com/su_downloads.html

If you are still seeing this bug, please re-open it and we will consider it for a future release.