mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-24 01:39:42 +01:00
don't delete a playlist if we don't have an updater for it or if it's already deleted
This commit is contained in:
parent
a80929e52f
commit
1a6f96caaf
@ -384,6 +384,13 @@ SpotifyAccount::registerUpdaterForPlaylist( const QString& plId, SpotifyPlaylist
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SpotifyAccount::unregisterUpdater( const QString& plid )
|
||||
{
|
||||
m_updaters.remove( plid );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SpotifyAccount::fetchFullPlaylist( SpotifyPlaylistInfo* playlist )
|
||||
{
|
||||
@ -406,7 +413,7 @@ SpotifyAccount::stopPlaylistSync( SpotifyPlaylistInfo* playlist )
|
||||
|
||||
m_spotifyResolver.data()->sendMessage( msg );
|
||||
|
||||
if ( deleteOnUnsync() )
|
||||
if ( deleteOnUnsync() && m_updaters.contains( playlist->plid ) )
|
||||
{
|
||||
SpotifyPlaylistUpdater* updater = m_updaters.take( playlist->plid );
|
||||
playlist_ptr tomahawkPl = updater->playlist();
|
||||
|
@ -86,7 +86,9 @@ public:
|
||||
virtual SipPlugin* sipPlugin() { return 0; }
|
||||
|
||||
void sendMessage( const QVariantMap& msg, QObject* receiver, const QString& slot );
|
||||
|
||||
void registerUpdaterForPlaylist( const QString& plId, SpotifyPlaylistUpdater* updater );
|
||||
void unregisterUpdater( const QString& plid );
|
||||
|
||||
bool deleteOnUnsync() const;
|
||||
private slots:
|
||||
|
@ -85,7 +85,10 @@ SpotifyPlaylistUpdater::init()
|
||||
|
||||
SpotifyPlaylistUpdater::~SpotifyPlaylistUpdater()
|
||||
{
|
||||
|
||||
if ( !m_spotify.isNull() )
|
||||
{
|
||||
m_spotify.data()->unregisterUpdater( m_spotifyId );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user