1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 12:02:48 +01:00

Play the mp3s without commercials for magnatune subscribers

This commit is contained in:
David Sansome 2010-06-08 23:29:50 +00:00
parent 38a92e802b
commit 7a6df2860f

View File

@ -278,7 +278,9 @@ QUrl MagnatuneService::ModifyUrl(const QUrl& url) const {
switch(membership_) { switch(membership_) {
case Membership_None: case Membership_None:
return ret; return ret; // Use the URL as-is
// Otherwise add the hostname
case Membership_Streaming: case Membership_Streaming:
ret.setHost(kStreamingHostname); ret.setHost(kStreamingHostname);
break; break;
@ -287,8 +289,14 @@ QUrl MagnatuneService::ModifyUrl(const QUrl& url) const {
break; break;
} }
// Add the credentials
ret.setUserName(username_); ret.setUserName(username_);
ret.setPassword(password_); ret.setPassword(password_);
qDebug() << url << "becomes" << ret;
// And remove the commercial
QString path = ret.path();
path.insert(path.lastIndexOf('.'), "_nospeech");
ret.setPath(path);
return ret; return ret;
} }