1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

Now supports charts from last.fm, billboard, itunes. Known issue:

sometimes fail to populate breadcrumb with itunes resource
This commit is contained in:
Hugo Lindström 2011-10-08 20:14:26 +02:00
parent 8595539dea
commit 36855783a7
2 changed files with 7 additions and 9 deletions

View File

@ -32,8 +32,8 @@
#include "utils/tomahawkutils.h"
#include "utils/logger.h"
//#define CHART_URL "http://charts.tomahawk-player.org:10080/"
#define CHART_URL "http://localhost:8080/"
#define CHART_URL "http://charts.tomahawk-player.org:10080/"
//#define CHART_URL "http://localhost:8080/"
#include <qjson/parser.h>
#include <qjson/serializer.h>
@ -234,11 +234,11 @@ ChartsPlugin::notInCacheSlot( uint requestId, QHash<QString, QString> criteria,
{
/// Itunes supplys charts based on geo, for now, only take US charts
/// @todo: Add new breadcrumb option for country?
/*if( type.toMap().value( "source" ).toString() == chartResource.toString()
if( type.toMap().value( "source" ).toString() == chartResource.toString()
&& type.toMap().value( "geo" ).isValid()
&& type.toMap().value( "geo" ).toString() != "us" )
continue;
*/
/// Append each type to its parent source
/// @todo Add chartType enum
if( type.toMap().value( "source" ).toString() == chartResource.toString() )
@ -364,8 +364,8 @@ ChartsPlugin::chartReturned()
if( chartType() == Album )
{
/** HACK, billboard chart returns wrong typename **/
//if( res.value( "source" ).toString() == "billboard" )
// album = chartMap.value( "track" ).toString();
if( res.value( "source" ).toString() == "billboard" )
album = chartMap.value( "track" ).toString();
if ( album.isEmpty() && artist.isEmpty() ) // don't have enough...
{

View File

@ -208,13 +208,12 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
}
else if( type == "albums" )
{
/// @todo: Fill the empty albums with resolved ones.
setLeftViewAlbums();
m_albumsModel->clear();
QList<album_ptr> al;
const QList<Tomahawk::InfoSystem::ArtistAlbumPair> albums = returnedData["albums"].value<QList<Tomahawk::InfoSystem::ArtistAlbumPair> >();
tDebug( LOGVERBOSE ) << "WhatsHot: got albums! " << albums.size();
foreach ( const Tomahawk::InfoSystem::ArtistAlbumPair& album, albums )
{
qDebug() << "Getting album" << album.album << "By" << album.artist;
@ -227,7 +226,6 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
qDebug() << "Adding albums to model";
m_albumsModel->addAlbums( al );
}
else if( type == "tracks" )
{