1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

* Ignore result-hint if source is currently offline & try to resolve again.

* Fixed crash related to result hints.
This commit is contained in:
Christian Muehlhaeuser
2011-02-28 09:20:21 +01:00
parent 2ce7e76d95
commit b795b0cf02
2 changed files with 4 additions and 2 deletions

View File

@@ -24,8 +24,9 @@ DatabaseCommand_Resolve::exec( DatabaseImpl* lib )
qDebug() << "Using result-hint to speed up resolving:" << m_query->resultHint(); qDebug() << "Using result-hint to speed up resolving:" << m_query->resultHint();
Tomahawk::result_ptr result = lib->result( m_query->resultHint() ); Tomahawk::result_ptr result = lib->result( m_query->resultHint() );
if ( !result.isNull() ) if ( !result.isNull() && result->collection()->source()->isOnline() )
{ {
res << result;
emit results( m_query->id(), res ); emit results( m_query->id(), res );
return; return;
} }

View File

@@ -459,7 +459,7 @@ DatabaseImpl::result( const QString& url )
{ {
TomahawkSqlQuery query = newquery(); TomahawkSqlQuery query = newquery();
Tomahawk::source_ptr s; Tomahawk::source_ptr s;
Tomahawk::result_ptr res; Tomahawk::result_ptr res = Tomahawk::result_ptr( new Tomahawk::Result() );
QString fileUrl; QString fileUrl;
if ( url.contains( "servent://" ) ) if ( url.contains( "servent://" ) )
@@ -539,6 +539,7 @@ DatabaseImpl::result( const QString& url )
res->setAlbumPos( query.value( 14 ).toUInt() ); res->setAlbumPos( query.value( 14 ).toUInt() );
res->setRID( uuid() ); res->setRID( uuid() );
res->setId( query.value( 9 ).toUInt() ); res->setId( query.value( 9 ).toUInt() );
res->setCollection( s->collection() );
} }
return res; return res;