From cb95f7b27d917e3862d4ce21cfd1e762eda02170 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Thu, 19 Jun 2014 15:18:40 +0100 Subject: [PATCH] Fix TWK-1397 --- .../accounts/spotify/SpotifyAccount.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libtomahawk/accounts/spotify/SpotifyAccount.cpp b/src/libtomahawk/accounts/spotify/SpotifyAccount.cpp index 0347eb94f..65bda0d09 100644 --- a/src/libtomahawk/accounts/spotify/SpotifyAccount.cpp +++ b/src/libtomahawk/accounts/spotify/SpotifyAccount.cpp @@ -911,11 +911,21 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg else if ( msgType == "tracksRemoved" ) { const QString plid = msg.value( "playlistid" ).toString(); - // We should already be syncing this playlist if we get updates for it -// Q_ASSERT( m_updaters.contains( plid ) ); if ( !m_updaters.contains( plid ) ) + { + // If the resolver gets out-of-sync with Tomahawk's config, also + // inform it that we do not sync the playlist anymore. This is a + // very rare case but will lead to crashes if we do not sync + // Tomahawk's sync settings to the resolver. See TWK-1397. + QVariantMap msg; + msg[ "_msgtype" ] = "removeFromSyncList"; + msg[ "playlistid" ] = plid; + + m_spotifyResolver.data()->sendMessage( msg ); + return; + } SpotifyPlaylistInfo* info = m_allSpotifyPlaylists[ plid ]; if( (info && info->starContainer ) && loveSync() )