1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-10 16:14:40 +02:00
This commit is contained in:
Leo Franchi
2012-01-08 18:32:10 -05:00
parent a78ef004f0
commit 8483e38f58

View File

@@ -323,12 +323,12 @@ hypemPlugin::chartReturned()
QList< InfoStringHash > top_tracks; QList< InfoStringHash > top_tracks;
QStringList top_artists; QStringList top_artists;
if( url.contains( "artists" ) ) if ( url.contains( "artists" ) )
setChartType( Artist ); setChartType( Artist );
else else
setChartType( Track ); setChartType( Track );
foreach(QVariant result, res ) foreach ( QVariant result, res )
{ {
QString title, artist; QString title, artist;
QVariantMap chartMap = result.toMap(); QVariantMap chartMap = result.toMap();
@@ -339,28 +339,21 @@ hypemPlugin::chartReturned()
title = chartMap.value( "title" ).toString(); title = chartMap.value( "title" ).toString();
artist = chartMap.value( "artist" ).toString(); artist = chartMap.value( "artist" ).toString();
if( chartType() == Track ) if ( chartType() == Track )
{ {
InfoStringHash pair; InfoStringHash pair;
pair["artist"] = artist; pair["artist"] = artist;
pair["track"] = title; pair["track"] = title;
top_tracks << pair; top_tracks << pair;
qDebug() << "HypemChart type is track";
} }
if( chartType() == Artist ) if ( chartType() == Artist )
{
top_artists << artist; top_artists << artist;
qDebug() << "HypemChart type is artist";
}
} }
} }
if( chartType() == Track ) if ( chartType() == Track )
{ {
tDebug() << "HypemPlugin:" << "\tgot " << top_tracks.size() << " tracks"; tDebug() << "HypemPlugin:" << "\tgot " << top_tracks.size() << " tracks";
returnedData["tracks"] = QVariant::fromValue( top_tracks ); returnedData["tracks"] = QVariant::fromValue( top_tracks );
@@ -369,7 +362,7 @@ hypemPlugin::chartReturned()
if( chartType() == Artist ) if ( chartType() == Artist )
{ {
tDebug() << "HypemPlugin:" << "\tgot " << top_artists.size() << " artists"; tDebug() << "HypemPlugin:" << "\tgot " << top_artists.size() << " artists";
returnedData["artists"] = top_artists; returnedData["artists"] = top_artists;