1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-02-24 11:53:09 +01:00

Hopefully fix infinite loop caused by requesting a cover when the cache has issues and/or can't find the cover.

This commit is contained in:
Alejandro Wainzinger 2011-08-21 11:57:23 -07:00
parent 48aeddc0a9
commit 573e36fdfd

View File

@ -493,7 +493,7 @@ MprisPlugin::audioStarted( const QVariant &input )
return;
m_playbackStatus = "Playing";
//notifyPropertyChanged( "org.mpris.MediaPlayer2.Player", "Metadata");
notifyPropertyChanged( "org.mpris.MediaPlayer2.Player", "Metadata");
//hash["artist"];
//hash["title"];
@ -576,15 +576,16 @@ MprisPlugin::onTrackCountChanged( unsigned int tracks )
void
MprisPlugin::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
{
// If the caller for the request was not us, or not the type of info we are seeking, ignore it
if ( requestData.caller != s_mpInfoIdentifier || requestData.type != Tomahawk::InfoSystem::InfoAlbumCoverArt )
{
notifyPropertyChanged( "org.mpris.MediaPlayer2.Player", "Metadata" );
//notifyPropertyChanged( "org.mpris.MediaPlayer2.Player", "Metadata" );
return;
}
if ( !output.canConvert< QVariantMap >() )
{
notifyPropertyChanged( "org.mpris.MediaPlayer2.Player", "Metadata" );
//notifyPropertyChanged( "org.mpris.MediaPlayer2.Player", "Metadata" );
tDebug( LOGINFO ) << "Cannot convert fetched art from a QByteArray";
return;
}
@ -623,11 +624,16 @@ MprisPlugin::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData,
{
qDebug() << Q_FUNC_INFO << "Image saving successful, notifying";
qDebug() << "Saving to: " << QFileInfo( *m_coverTempFile ).absoluteFilePath();
m_coverTempFile->close();
notifyPropertyChanged( "org.mpris.MediaPlayer2.Player", "Metadata" );
}
else
{
qDebug() << Q_FUNC_INFO << " failed to save image!";
m_coverTempFile->close();
}
m_coverTempFile->close();
/*
if( m_coverTempFile->open() )
@ -639,8 +645,6 @@ MprisPlugin::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData,
}
*/
}
notifyPropertyChanged( "org.mpris.MediaPlayer2.Player", "Metadata" );
}