mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 08:34:34 +02:00
Fix resulthint saving
This commit is contained in:
@@ -200,23 +200,19 @@ DatabaseCommand_SetPlaylistRevision::exec( DatabaseImpl* lib )
|
||||
m_addedmap.insert( e->guid(), e ); // needed in postcommithook
|
||||
|
||||
QString resultHint, foundResult;
|
||||
// Whitelist resulthint protocols
|
||||
bool fromQuery = false;
|
||||
if ( !e->query()->results().isEmpty() )
|
||||
foundResult = e->query()->results().first()->url();
|
||||
else if ( !e->query()->resultHint().isEmpty() )
|
||||
{
|
||||
resultHint = e->query()->resultHint();
|
||||
foundResult = true;
|
||||
}
|
||||
foundResult = e->query()->resultHint();
|
||||
|
||||
if ( resultHint.startsWith( "file://" ) ||
|
||||
resultHint.startsWith( "servent://" ) || // Save resulthints for local files and peers automatically
|
||||
( fromQuery && e->query()->saveHTTPResultHint() ) )
|
||||
if ( foundResult.startsWith( "file://" ) ||
|
||||
foundResult.startsWith( "servent://" ) || // Save resulthints for local files and peers automatically
|
||||
( foundResult.startsWith( "http" ) && e->query()->saveHTTPResultHint() ) )
|
||||
{
|
||||
resultHint = foundResult;
|
||||
}
|
||||
|
||||
|
||||
adde.bindValue( 0, e->guid() );
|
||||
adde.bindValue( 1, m_playlistguid );
|
||||
adde.bindValue( 2, e->query()->track() );
|
||||
|
@@ -618,9 +618,8 @@ DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
|
||||
s = SourceList::instance()->getLocal();
|
||||
fileUrl = url;
|
||||
}
|
||||
else
|
||||
else if ( !url.isEmpty() )
|
||||
{
|
||||
// Q_ASSERT( false );
|
||||
res = Tomahawk::Result::get( url );
|
||||
res->setRID( uuid() );
|
||||
res->setScore( 1.0 );
|
||||
|
Reference in New Issue
Block a user