From bd893995c3acf176cd4794fd0636dfef47c06dbf Mon Sep 17 00:00:00 2001 From: Stefan Derkits Date: Sat, 24 Dec 2011 22:43:25 +0100 Subject: [PATCH] Allow parsing of grooveshark tinysong.com links --- src/libtomahawk/utils/groovesharkparser.cpp | 4 +++- src/libtomahawk/utils/shortenedlinkparser.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/utils/groovesharkparser.cpp b/src/libtomahawk/utils/groovesharkparser.cpp index 6ee245c56..59c898822 100644 --- a/src/libtomahawk/utils/groovesharkparser.cpp +++ b/src/libtomahawk/utils/groovesharkparser.cpp @@ -93,7 +93,9 @@ GroovesharkParser::lookupGroovesharkPlaylist( const QString& linkRaw ) QStringList urlParts = linkRaw.split( "/" ); bool ok; - int playlistID = urlParts.last().toInt( &ok, 10 ); + QString playlistStr = urlParts.last(); + playlistStr.truncate(playlistStr.indexOf("?")); + int playlistID = playlistStr.toInt( &ok, 10 ); if (!ok) { tDebug() << "incorrect grooveshark url"; diff --git a/src/libtomahawk/utils/shortenedlinkparser.cpp b/src/libtomahawk/utils/shortenedlinkparser.cpp index 0e196449d..6c37f951e 100644 --- a/src/libtomahawk/utils/shortenedlinkparser.cpp +++ b/src/libtomahawk/utils/shortenedlinkparser.cpp @@ -56,6 +56,7 @@ ShortenedLinkParser::handlesUrl( const QString& url ) url.contains( "fb.me" ) || url.contains( "itun.es" ) || url.contains( "tinyurl.com" ) || + url.contains( "tinysong.com" ) || url.contains( "rd.io" ) ); }