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

Send resulthint when we have it

This commit is contained in:
Hugo Lindström
2012-07-19 00:50:07 +02:00
committed by Leo Franchi
parent 70a5050443
commit 34dc6d23ee
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> === /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
* *
* Copyright 2010-2012, Leo Franchi <lfranchi@kde.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 * Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -680,8 +681,10 @@ SpotifyPlaylistUpdater::variantToQueries( const QVariantList& list )
continue; continue;
if ( trackMap.contains( "id" ) ) if ( trackMap.contains( "id" ) )
{
q->setResultHint( trackMap.value( "id" ).toString() );
q->setProperty( "annotation", trackMap.value( "id" ) ); q->setProperty( "annotation", trackMap.value( "id" ) );
}
queries << q; queries << q;
} }

View File

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

View File

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

View File

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