Skip to content

Commit

Permalink
backwards compatibility to libre.fm protocol
Browse files Browse the repository at this point in the history
closes #43
  • Loading branch information
hrkfdn committed Nov 6, 2017
1 parent 8357b79 commit 4b997f7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion audioscrobbler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,16 @@ void CAudioScrobbler::Handshake()

msg.AddField("method", "auth.getMobileSession");
msg.AddField("username", username);
msg.AddField("password", password);

if(_cfg->getService() == LastFm) {
msg.AddField("password", password);
}
else {
std::string password_hashed(md5sum((char*)"%s", password.c_str()));
std::string authtoken(md5sum((char*)"%s%s", username.c_str(), password_hashed.c_str()));
msg.AddField("authToken", authtoken);
msg.AddField("password", password_hashed);
}
msg.AddField("api_key", APIKEY);

OpenURL(GetServiceURL(), msg.GetMessage().c_str());
Expand Down

0 comments on commit 4b997f7

Please sign in to comment.