1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-16 11:04:01 +02:00

* No need to check all results for playability. Their sorted by that, so we just check the first one.

This commit is contained in:
Christian Muehlhaeuser
2012-06-27 02:18:41 +02:00
parent 3fb403c695
commit fa4463dc88

View File

@@ -604,14 +604,11 @@ AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk:
{ {
if ( query->resolvingFinished() ) if ( query->resolvingFinished() )
{ {
foreach ( const result_ptr& result, query->results() ) if ( query->numResults() && query->results().first()->isOnline() )
{ {
if ( result->isOnline() ) playItem( playlist, query->results().first() );
{
playItem( playlist, result );
return; return;
} }
}
JobStatusView::instance()->model()->addJob( JobStatusView::instance()->model()->addJob(
new ErrorStatusMessage( tr( "Sorry, Tomahawk couldn't find the track '%1' by %2" ).arg( query->track() ).arg( query->artist() ), 15 ) ); new ErrorStatusMessage( tr( "Sorry, Tomahawk couldn't find the track '%1' by %2" ).arg( query->track() ).arg( query->artist() ), 15 ) );