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:
parent
8595539dea
commit
36855783a7
@ -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...
|
||||
{
|
||||
|
@ -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" )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user