mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
* Use new biography API call in Artist class.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "database/IdThreadWorker.h"
|
||||
#include "Source.h"
|
||||
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#include <QReadWriteLock>
|
||||
@@ -300,13 +301,14 @@ Artist::biography() const
|
||||
{
|
||||
if ( !m_biographyLoaded )
|
||||
{
|
||||
Tomahawk::InfoSystem::InfoStringHash trackInfo;
|
||||
trackInfo["artist"] = name();
|
||||
|
||||
Tomahawk::InfoSystem::InfoRequestData requestData;
|
||||
requestData.caller = infoid();
|
||||
requestData.customData = QVariantMap();
|
||||
|
||||
requestData.input = name();
|
||||
requestData.type = Tomahawk::InfoSystem::InfoArtistBiography;
|
||||
requestData.requestId = TomahawkUtils::infosystemRequestId();
|
||||
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo );
|
||||
requestData.customData = QVariantMap();
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
|
||||
@@ -454,7 +456,6 @@ Artist::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVari
|
||||
case InfoSystem::InfoArtistBiography:
|
||||
{
|
||||
QVariantMap bmap = output.toMap();
|
||||
|
||||
foreach ( const QString& source, bmap.keys() )
|
||||
{
|
||||
if ( source == "last.fm" )
|
||||
@@ -530,9 +531,11 @@ Artist::cover( const QSize& size, bool forceLoad ) const
|
||||
|
||||
if ( !m_cover && !m_coverBuffer.isEmpty() )
|
||||
{
|
||||
m_cover = new QPixmap();
|
||||
m_cover->loadFromData( m_coverBuffer );
|
||||
QPixmap cover;
|
||||
cover.loadFromData( m_coverBuffer );
|
||||
m_coverBuffer.clear();
|
||||
|
||||
m_cover = new QPixmap( TomahawkUtils::squareCenterPixmap( cover ) );
|
||||
}
|
||||
|
||||
if ( m_cover && !m_cover->isNull() && !size.isEmpty() )
|
||||
|
Reference in New Issue
Block a user