mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-18 23:09:42 +01:00
Don't check whitelist everytime we want to resolve a redirect
This commit is contained in:
parent
014c6e7344
commit
3655a2b537
@ -57,7 +57,6 @@ ShortenedLinkParser::handlesUrl( const QString& url )
|
||||
url.contains( "itun.es" ) ||
|
||||
url.contains( "tinyurl.com" ) ||
|
||||
url.contains( "tinysong.com" ) ||
|
||||
url.contains( "grooveshark.com" ) ||
|
||||
url.contains( "rd.io" ) );
|
||||
}
|
||||
|
||||
@ -67,7 +66,14 @@ ShortenedLinkParser::lengthenUrl( const QString& url )
|
||||
{
|
||||
if ( !handlesUrl( url ) )
|
||||
return;
|
||||
|
||||
lengthenShortUrl( url );
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
ShortenedLinkParser::lengthenShortUrl ( const QString& url )
|
||||
{
|
||||
tDebug() << "Looking up..." << url;
|
||||
|
||||
QNetworkReply* reply = TomahawkUtils::nam()->get( QNetworkRequest( QUrl( url ) ) );
|
||||
@ -76,7 +82,6 @@ ShortenedLinkParser::lengthenUrl( const QString& url )
|
||||
m_queries.insert( reply );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShortenedLinkParser::lookupFinished()
|
||||
{
|
||||
@ -89,7 +94,7 @@ ShortenedLinkParser::lookupFinished()
|
||||
tDebug() << "RedirectionTargetAttribute set on " << redir;
|
||||
m_queries.remove( r );
|
||||
r->deleteLater();
|
||||
lengthenUrl( redir.toUrl().toString() );
|
||||
lengthenShortUrl( redir.toUrl().toString() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -56,6 +56,7 @@ signals:
|
||||
|
||||
private:
|
||||
void lengthenUrl( const QString& url );
|
||||
void lengthenShortUrl( const QString& url );
|
||||
void checkFinished();
|
||||
|
||||
QStringList m_links;
|
||||
|
Loading…
x
Reference in New Issue
Block a user