1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 00:24:12 +02:00

Send resulthint when we have it

This commit is contained in:
Hugo Lindström
2012-07-19 00:50:07 +02:00
parent 454944d089
commit 14457750ff
4 changed files with 14 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2012, Leo Franchi <lfranchi@kde.org>
* Copyright 2012, Hugo Lindström <hugolm84@gmail.com>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -731,8 +732,10 @@ SpotifyPlaylistUpdater::variantToQueries( const QVariantList& list )
continue;
if ( trackMap.contains( "id" ) )
{
q->setResultHint( trackMap.value( "id" ).toString() );
q->setProperty( "annotation", trackMap.value( "id" ) );
}
queries << q;
}

View File

@@ -1,7 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2012, Leo Franchi <lfranchi@kde.org>
*
* Copyright 2012, Hugo Lindström <hugolm84@gmail.com>
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or

View File

@@ -341,6 +341,8 @@ ScriptResolver::resolve( const Tomahawk::query_ptr& query )
QVariantMap m;
m.insert( "_msgtype", "rq" );
m.insert( "resultHint", query->resultHint() );
if ( query->isFullTextQuery() )
{
m.insert( "fulltext", query->fullTextQuery() );

View File

@@ -235,6 +235,9 @@ SpotifyParser::spotifyBrowseFinished()
if ( q.isNull() )
continue;
tLog() << "Setting resulthint to " << trackResult.value( "trackuri" );
q->setResultHint( trackResult.value("trackuri").toString() );
m_tracks << q;
}
}
@@ -298,7 +301,11 @@ SpotifyParser::spotifyTrackLookupFinished()
Tomahawk::query_ptr q = Tomahawk::Query::get( artist, title, album, uuid(), m_trackMode );
if ( !q.isNull() )
{
tLog() << "Setting resulthint to " << t.value( "trackuri" );
q->setResultHint( t.value("trackuri").toString() );
m_tracks << q;
}
}
else
{