1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-21 13:21:52 +02:00

Be a bit smarter about when we consider info loaded and updated

This commit is contained in:
Jeff Mitchell
2012-04-06 16:51:25 -04:00
parent 55d80eb547
commit 0c308b850d
2 changed files with 8 additions and 5 deletions

View File

@@ -174,12 +174,13 @@ Album::infoSystemInfo( const Tomahawk::InfoSystem::InfoRequestData& requestData,
return;
}
if ( !output.isNull() && output.isValid() )
if ( !output.isNull() && output.isValid() && !m_infoLoaded )
{
QVariantMap returnedData = output.value< QVariantMap >();
const QByteArray ba = returnedData["imgbytes"].toByteArray();
if ( ba.length() )
{
m_infoLoaded = true;
m_coverBuffer = ba;
emit coverChanged();
@@ -200,7 +201,7 @@ Album::infoSystemFinished( const QString& target )
disconnect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ),
this, SLOT( infoSystemFinished( QString ) ) );
m_infoLoaded = true;
if ( m_infoLoaded )
emit updated();
}

View File

@@ -170,7 +170,9 @@ Artist::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVari
const QByteArray ba = returnedData["imgbytes"].toByteArray();
if ( ba.length() )
{
m_infoLoaded = true;
m_coverBuffer = ba;
emit coverChanged();
}
}
@@ -191,7 +193,7 @@ Artist::infoSystemFinished( QString target )
disconnect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ),
this, SLOT( infoSystemFinished( QString ) ) );
m_infoLoaded = true;
if ( m_infoLoaded )
emit updated();
}