Grooveshark now returns a different error code when session id is invalid

This commit is contained in:
Arnaud Bienner 2013-12-16 23:01:12 +01:00
parent a8ae737bce
commit 4d6406524f
1 changed files with 2 additions and 1 deletions

View File

@ -1651,10 +1651,11 @@ QVariantMap GroovesharkService::ExtractResult(QNetworkReply* reply) {
QVariantList::iterator it;
for (it = errors.begin(); it != errors.end(); ++it) {
QVariantMap error = (*it).toMap();
qLog(Error) << "Grooveshark error: " << error["message"].toString();
qLog(Error) << "Grooveshark error: (" << error["code"].toInt() <<") " << error["message"].toString();
switch (error["code"].toInt()) {
case 100: // User auth required
case 102: // User premium required
case 300: // Session required
// These errors can happen if session_id is obsolete (e.g. we haven't use
// it for more than two weeks): force the user to login again
Logout();