diff --git a/src/libtomahawk/database/DatabaseCommand_SetPlaylistRevision.cpp b/src/libtomahawk/database/DatabaseCommand_SetPlaylistRevision.cpp index 9bdba3a28..67a63c91f 100644 --- a/src/libtomahawk/database/DatabaseCommand_SetPlaylistRevision.cpp +++ b/src/libtomahawk/database/DatabaseCommand_SetPlaylistRevision.cpp @@ -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() ); diff --git a/src/libtomahawk/database/DatabaseImpl.cpp b/src/libtomahawk/database/DatabaseImpl.cpp index 332cd3374..e7b33393e 100644 --- a/src/libtomahawk/database/DatabaseImpl.cpp +++ b/src/libtomahawk/database/DatabaseImpl.cpp @@ -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 );