From 37583eb57f877f7e2a899e39880471fbd8c870bb Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 16 Feb 2016 16:48:49 +0100 Subject: [PATCH] Don't parse artists/albums for non-fulltext queries --- src/libtomahawk/resolvers/JSResolver.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/libtomahawk/resolvers/JSResolver.cpp b/src/libtomahawk/resolvers/JSResolver.cpp index 7a104c5f0..da1a1f0c5 100644 --- a/src/libtomahawk/resolvers/JSResolver.cpp +++ b/src/libtomahawk/resolvers/JSResolver.cpp @@ -541,9 +541,13 @@ void JSResolver::resolve( const Tomahawk::query_ptr& query ) { ScriptJob* job = scriptAccount()->resolve( scriptObject(), query, "resolver" ); - connect( job, SIGNAL( done( QVariantMap ) ), SLOT( onResolveRequestDone( QVariantMap ) ) ); + if ( query->isFullTextQuery() ) + { + job->setProperty( "isFullTextQuery", true ); + } + job->start(); } @@ -563,11 +567,14 @@ JSResolver::onResolveRequestDone( const QVariantMap& data ) } else { - QList< artist_ptr > artists = scriptAccount()->parseArtistVariantList( data.value( "artists" ).toList() ); - Tomahawk::Pipeline::instance()->reportArtists( qid, artists ); + if ( job->property( "isFullTextQuery" ).toBool() ) + { + QList< artist_ptr > artists = scriptAccount()->parseArtistVariantList( data.value( "artists" ).toList() ); + Tomahawk::Pipeline::instance()->reportArtists( qid, artists ); - QList< album_ptr > albums = scriptAccount()->parseAlbumVariantList( data.value( "albums" ).toList() ); - Tomahawk::Pipeline::instance()->reportAlbums( qid, albums ); + QList< album_ptr > albums = scriptAccount()->parseAlbumVariantList( data.value( "albums" ).toList() ); + Tomahawk::Pipeline::instance()->reportAlbums( qid, albums ); + } QList< Tomahawk::result_ptr > results = scriptAccount()->parseResultVariantList( data.value( "tracks" ).toList() ); foreach( const result_ptr& result, results )