Bugzilla – Bug 5933
AudioScrobbler settings reports '400 Bad Request'
Last modified: 2008-12-18 11:12:53 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)
<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).
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.
I added a better error message when it can't verify your account due to a Last.fm server problem.
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.