mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
Go back to old way of sending artists in charts, as old data type may be cached
This commit is contained in:
@@ -453,7 +453,7 @@ ChartsPlugin::chartReturned()
|
||||
QVariantList chartResponse = res.value( "list" ).toList();
|
||||
QList< Tomahawk::InfoSystem::InfoStringHash > top_tracks;
|
||||
QList< Tomahawk::InfoSystem::InfoStringHash > top_albums;
|
||||
QList< Tomahawk::InfoSystem::InfoStringHash > top_artists;
|
||||
QStringList top_artists;
|
||||
|
||||
/// Deside what type, we need to handle it differently
|
||||
/// @todo: We allready know the type, append it to breadcrumb hash
|
||||
@@ -528,9 +528,7 @@ ChartsPlugin::chartReturned()
|
||||
}
|
||||
else
|
||||
{
|
||||
Tomahawk::InfoSystem::InfoStringHash artistHash;
|
||||
artistHash["artist"] = artist;
|
||||
top_artists.append( artistHash );
|
||||
top_artists.append( artist );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -540,7 +538,7 @@ ChartsPlugin::chartReturned()
|
||||
if( chartType() == Artist )
|
||||
{
|
||||
tDebug() << "ChartsPlugin:" << "\tgot " << top_artists.size() << " artists";
|
||||
returnedData[ "artists" ] = QVariant::fromValue< QList< Tomahawk::InfoSystem::InfoStringHash > >( top_artists );
|
||||
returnedData[ "artists" ] = QVariant::fromValue< QStringList >( top_artists );
|
||||
returnedData[ "type" ] = "artists";
|
||||
}
|
||||
|
||||
|
@@ -45,8 +45,9 @@ ChartDataLoader::go()
|
||||
{
|
||||
QList< artist_ptr > artist_ptrs;
|
||||
|
||||
foreach ( const Tomahawk::InfoSystem::InfoStringHash& artistname, m_data ) {
|
||||
artist_ptrs << Artist::get( artistname[ "artist" ], false );
|
||||
foreach ( const QString& artistname, m_artists )
|
||||
{
|
||||
artist_ptrs << Artist::get( artistname, false );
|
||||
}
|
||||
|
||||
emit artists( this, artist_ptrs );
|
||||
|
@@ -47,6 +47,7 @@ public:
|
||||
|
||||
void setType( DataType type ) { m_type = type; }
|
||||
void setData( const QList< InfoSystem::InfoStringHash >& data ) { m_data = data; }
|
||||
void setData( const QStringList& artists ) { m_artists = artists; }
|
||||
|
||||
public slots:
|
||||
void go();
|
||||
@@ -60,6 +61,7 @@ signals:
|
||||
private:
|
||||
DataType m_type;
|
||||
QList<InfoSystem::InfoStringHash> m_data;
|
||||
QStringList m_artists;
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -253,7 +253,7 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
|
||||
if ( type == "artists" )
|
||||
{
|
||||
loader->setType( ChartDataLoader::Artist );
|
||||
loader->setData( returnedData[ "artists" ].value< QList< Tomahawk::InfoSystem::InfoStringHash > >() );
|
||||
loader->setData( returnedData[ "artists" ].value< QStringList >() );
|
||||
|
||||
connect( loader, SIGNAL( artists( Tomahawk::ChartDataLoader*, QList< Tomahawk::artist_ptr > ) ), this, SLOT( chartArtistsLoaded( Tomahawk::ChartDataLoader*, QList< Tomahawk::artist_ptr > ) ) );
|
||||
|
||||
@@ -479,10 +479,12 @@ WhatsHotWidget::chartArtistsLoaded( ChartDataLoader* loader, const QList< artist
|
||||
QString chartId = loader->property( "chartid" ).toString();
|
||||
Q_ASSERT( m_artistModels.contains( chartId ) );
|
||||
|
||||
if ( !m_artistModels.contains( chartId ) )
|
||||
if ( m_artistModels.contains( chartId ) )
|
||||
{
|
||||
foreach( const artist_ptr& artist, artists )
|
||||
{
|
||||
m_artistModels[ chartId ]->addArtists( artist );
|
||||
}
|
||||
}
|
||||
|
||||
loader->deleteLater();
|
||||
|
Reference in New Issue
Block a user