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

* Use new biography API call in Artist class.

This commit is contained in:
Christian Muehlhaeuser 2012-12-09 06:39:24 +01:00
parent 455e525b11
commit 14676071b9
2 changed files with 12 additions and 9 deletions

View File

@ -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() )

View File

@ -65,7 +65,7 @@ public:
QList< Tomahawk::PlaybackLog > playbackHistory( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() ) const;
void setPlaybackHistory( const QList< Tomahawk::PlaybackLog >& playbackData );
unsigned int playbackCount( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() );
QString biography() const;
#ifndef ENABLE_HEADLESS
@ -133,7 +133,7 @@ private:
#endif
QHash< Tomahawk::ModelMode, QHash< Tomahawk::collection_ptr, Tomahawk::playlistinterface_ptr > > m_playlistInterface;
QWeakPointer< Tomahawk::Artist > m_ownRef;
static QHash< QString, artist_ptr > s_artistsByName;