mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-29 00:30:04 +02:00
* Fixed using resolv-hints for offline sources.
This commit is contained in:
@@ -37,14 +37,21 @@ DatabaseCommand_Resolve::exec( DatabaseImpl* lib )
|
|||||||
if ( !m.isEmpty() )
|
if ( !m.isEmpty() )
|
||||||
{
|
{
|
||||||
if ( m.value( "srcid" ).toUInt() > 0 )
|
if ( m.value( "srcid" ).toUInt() > 0 )
|
||||||
coll = SourceList::instance()->get( m.value( "srcid" ).toUInt() )->collection();
|
{
|
||||||
|
source_ptr s = SourceList::instance()->get( m.value( "srcid" ).toUInt() );
|
||||||
|
if ( !s.isNull() )
|
||||||
|
coll = s->collection();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
coll = SourceList::instance()->getLocal()->collection();
|
coll = SourceList::instance()->getLocal()->collection();
|
||||||
|
|
||||||
res << Tomahawk::result_ptr( new Tomahawk::Result( m, coll ) );
|
if ( !coll.isNull() )
|
||||||
emit results( qid, res );
|
{
|
||||||
|
res << Tomahawk::result_ptr( new Tomahawk::Result( m, coll ) );
|
||||||
|
emit results( qid, res );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -477,6 +477,7 @@ DatabaseImpl::result( const QString& url )
|
|||||||
{
|
{
|
||||||
TomahawkSqlQuery query = newquery();
|
TomahawkSqlQuery query = newquery();
|
||||||
Tomahawk::source_ptr s;
|
Tomahawk::source_ptr s;
|
||||||
|
QVariantMap m;
|
||||||
QString fileUrl;
|
QString fileUrl;
|
||||||
|
|
||||||
if ( url.contains( "servent://" ) )
|
if ( url.contains( "servent://" ) )
|
||||||
@@ -484,6 +485,9 @@ DatabaseImpl::result( const QString& url )
|
|||||||
QStringList parts = url.mid( QString( "servent://" ).length() ).split( "\t" );
|
QStringList parts = url.mid( QString( "servent://" ).length() ).split( "\t" );
|
||||||
s = SourceList::instance()->get( parts.at( 0 ) );
|
s = SourceList::instance()->get( parts.at( 0 ) );
|
||||||
fileUrl = parts.at( 1 );
|
fileUrl = parts.at( 1 );
|
||||||
|
|
||||||
|
if ( s.isNull() )
|
||||||
|
return m;
|
||||||
}
|
}
|
||||||
else if ( url.contains( "file://" ) )
|
else if ( url.contains( "file://" ) )
|
||||||
{
|
{
|
||||||
@@ -518,7 +522,6 @@ DatabaseImpl::result( const QString& url )
|
|||||||
query.bindValue( 0, fileUrl );
|
query.bindValue( 0, fileUrl );
|
||||||
query.exec();
|
query.exec();
|
||||||
|
|
||||||
QVariantMap m;
|
|
||||||
if( query.next() )
|
if( query.next() )
|
||||||
{
|
{
|
||||||
const QString url_str = query.value( 0 ).toString();
|
const QString url_str = query.value( 0 ).toString();
|
||||||
|
Reference in New Issue
Block a user