mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Fix some rdio stuff
This commit is contained in:
@@ -112,7 +112,8 @@ DropJob::acceptsMimeData( const QMimeData* data, DropJob::DropTypes acceptedType
|
|||||||
if ( url.contains( "spotify" ) && url.contains( "track" ) )
|
if ( url.contains( "spotify" ) && url.contains( "track" ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if ( url.contains( "rdio.com" ) && ( url.contains( "track" ) || /*url.contains( "artist" ) ||*/ url.contains( "album" ) || url.contains( "playlists" ) ) )
|
if ( url.contains( "rdio.com" ) && ( ( ( url.contains( "track" ) && url.contains( "artist" ) && url.contains( "album" ) )
|
||||||
|
|| url.contains( "playlists" ) ) ) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,6 +123,8 @@ DropJob::acceptsMimeData( const QMimeData* data, DropJob::DropTypes acceptedType
|
|||||||
return true;
|
return true;
|
||||||
if ( url.contains( "spotify" ) && url.contains( "album" ) )
|
if ( url.contains( "spotify" ) && url.contains( "album" ) )
|
||||||
return true;
|
return true;
|
||||||
|
if ( url.contains( "rdio.com" ) && ( url.contains( "artist" ) && url.contains( "album" ) && !url.contains( "track" ) ) )
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( acceptedType.testFlag( Artist ) )
|
if ( acceptedType.testFlag( Artist ) )
|
||||||
@@ -130,6 +133,8 @@ DropJob::acceptsMimeData( const QMimeData* data, DropJob::DropTypes acceptedType
|
|||||||
return true;
|
return true;
|
||||||
if ( url.contains( "spotify" ) && url.contains( "artist" ) )
|
if ( url.contains( "spotify" ) && url.contains( "artist" ) )
|
||||||
return true;
|
return true;
|
||||||
|
if ( url.contains( "rdio.com" ) && ( url.contains( "artist" ) && !url.contains( "album" ) && !url.contains( "track" ) ) )
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We whitelist t.co and bit.ly (and j.mp) since they do some link checking. Often playable (e.g. spotify..) links hide behind them,
|
// We whitelist t.co and bit.ly (and j.mp) since they do some link checking. Often playable (e.g. spotify..) links hide behind them,
|
||||||
@@ -463,16 +468,11 @@ DropJob::handleRdioUrls( const QString& urlsRaw )
|
|||||||
setDropAction( Create );
|
setDropAction( Create );
|
||||||
|
|
||||||
RdioParser* rdio = new RdioParser( this );
|
RdioParser* rdio = new RdioParser( this );
|
||||||
|
connect( rdio, SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ), this, SLOT( onTracksAdded( QList< Tomahawk::query_ptr > ) ) );
|
||||||
|
|
||||||
rdio->setCreatePlaylist( dropAction() == Create );
|
rdio->setCreatePlaylist( dropAction() == Create );
|
||||||
rdio->parse( urls );
|
rdio->parse( urls );
|
||||||
|
|
||||||
/// This currently supports draging and dropping a spotify playlist and artist
|
|
||||||
if ( dropAction() == Append )
|
|
||||||
{
|
|
||||||
tDebug() << Q_FUNC_INFO << "Asking for spotify browse contents from" << urls;
|
|
||||||
connect( rdio, SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ), this, SLOT( onTracksAdded( QList< Tomahawk::query_ptr > ) ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_queryCount++;
|
m_queryCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -236,7 +236,7 @@ RdioParser::parseTrack( const QString& origUrl )
|
|||||||
|
|
||||||
query_ptr q = Query::get( artist, trk, album, uuid(), !m_createPlaylist );
|
query_ptr q = Query::get( artist, trk, album, uuid(), !m_createPlaylist );
|
||||||
m_count++;
|
m_count++;
|
||||||
m_queries << q;
|
m_tracks << q;
|
||||||
|
|
||||||
checkFinished();
|
checkFinished();
|
||||||
}
|
}
|
||||||
@@ -334,6 +334,7 @@ RdioParser::checkFinished()
|
|||||||
m_tracks );
|
m_tracks );
|
||||||
|
|
||||||
connect( m_playlist.data(), SIGNAL( revisionLoaded( Tomahawk::PlaylistRevision ) ), this, SLOT( playlistCreated() ) );
|
connect( m_playlist.data(), SIGNAL( revisionLoaded( Tomahawk::PlaylistRevision ) ), this, SLOT( playlistCreated() ) );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -342,6 +343,8 @@ RdioParser::checkFinished()
|
|||||||
emit track( m_tracks.first() );
|
emit track( m_tracks.first() );
|
||||||
else if ( m_multi && m_count == m_total )
|
else if ( m_multi && m_count == m_total )
|
||||||
emit tracks( m_tracks );
|
emit tracks( m_tracks );
|
||||||
|
|
||||||
|
m_tracks.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteLater();
|
deleteLater();
|
||||||
|
@@ -82,7 +82,6 @@ private:
|
|||||||
|
|
||||||
bool m_multi;
|
bool m_multi;
|
||||||
int m_count, m_total;
|
int m_count, m_total;
|
||||||
QList< query_ptr > m_queries;
|
|
||||||
QSet< QNetworkReply* > m_reqQueries;
|
QSet< QNetworkReply* > m_reqQueries;
|
||||||
DropJobNotifier* m_browseJob;
|
DropJobNotifier* m_browseJob;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user