mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 00:24:12 +02:00
* Use new biography API call in Artist class.
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
#include "database/IdThreadWorker.h"
|
#include "database/IdThreadWorker.h"
|
||||||
#include "Source.h"
|
#include "Source.h"
|
||||||
|
|
||||||
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <QReadWriteLock>
|
#include <QReadWriteLock>
|
||||||
@@ -300,13 +301,14 @@ Artist::biography() const
|
|||||||
{
|
{
|
||||||
if ( !m_biographyLoaded )
|
if ( !m_biographyLoaded )
|
||||||
{
|
{
|
||||||
|
Tomahawk::InfoSystem::InfoStringHash trackInfo;
|
||||||
|
trackInfo["artist"] = name();
|
||||||
|
|
||||||
Tomahawk::InfoSystem::InfoRequestData requestData;
|
Tomahawk::InfoSystem::InfoRequestData requestData;
|
||||||
requestData.caller = infoid();
|
requestData.caller = infoid();
|
||||||
requestData.customData = QVariantMap();
|
|
||||||
|
|
||||||
requestData.input = name();
|
|
||||||
requestData.type = Tomahawk::InfoSystem::InfoArtistBiography;
|
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(),
|
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||||
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
|
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
|
||||||
@@ -454,7 +456,6 @@ Artist::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVari
|
|||||||
case InfoSystem::InfoArtistBiography:
|
case InfoSystem::InfoArtistBiography:
|
||||||
{
|
{
|
||||||
QVariantMap bmap = output.toMap();
|
QVariantMap bmap = output.toMap();
|
||||||
|
|
||||||
foreach ( const QString& source, bmap.keys() )
|
foreach ( const QString& source, bmap.keys() )
|
||||||
{
|
{
|
||||||
if ( source == "last.fm" )
|
if ( source == "last.fm" )
|
||||||
@@ -530,9 +531,11 @@ Artist::cover( const QSize& size, bool forceLoad ) const
|
|||||||
|
|
||||||
if ( !m_cover && !m_coverBuffer.isEmpty() )
|
if ( !m_cover && !m_coverBuffer.isEmpty() )
|
||||||
{
|
{
|
||||||
m_cover = new QPixmap();
|
QPixmap cover;
|
||||||
m_cover->loadFromData( m_coverBuffer );
|
cover.loadFromData( m_coverBuffer );
|
||||||
m_coverBuffer.clear();
|
m_coverBuffer.clear();
|
||||||
|
|
||||||
|
m_cover = new QPixmap( TomahawkUtils::squareCenterPixmap( cover ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_cover && !m_cover->isNull() && !size.isEmpty() )
|
if ( m_cover && !m_cover->isNull() && !size.isEmpty() )
|
||||||
|
@@ -65,7 +65,7 @@ public:
|
|||||||
QList< Tomahawk::PlaybackLog > playbackHistory( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() ) const;
|
QList< Tomahawk::PlaybackLog > playbackHistory( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() ) const;
|
||||||
void setPlaybackHistory( const QList< Tomahawk::PlaybackLog >& playbackData );
|
void setPlaybackHistory( const QList< Tomahawk::PlaybackLog >& playbackData );
|
||||||
unsigned int playbackCount( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() );
|
unsigned int playbackCount( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() );
|
||||||
|
|
||||||
QString biography() const;
|
QString biography() const;
|
||||||
|
|
||||||
#ifndef ENABLE_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
@@ -133,7 +133,7 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
QHash< Tomahawk::ModelMode, QHash< Tomahawk::collection_ptr, Tomahawk::playlistinterface_ptr > > m_playlistInterface;
|
QHash< Tomahawk::ModelMode, QHash< Tomahawk::collection_ptr, Tomahawk::playlistinterface_ptr > > m_playlistInterface;
|
||||||
|
|
||||||
QWeakPointer< Tomahawk::Artist > m_ownRef;
|
QWeakPointer< Tomahawk::Artist > m_ownRef;
|
||||||
|
|
||||||
static QHash< QString, artist_ptr > s_artistsByName;
|
static QHash< QString, artist_ptr > s_artistsByName;
|
||||||
|
Reference in New Issue
Block a user