mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02: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:
@@ -384,6 +384,13 @@ SpotifyAccount::registerUpdaterForPlaylist( const QString& plId, SpotifyPlaylist
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SpotifyAccount::unregisterUpdater( const QString& plid )
|
||||||
|
{
|
||||||
|
m_updaters.remove( plid );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SpotifyAccount::fetchFullPlaylist( SpotifyPlaylistInfo* playlist )
|
SpotifyAccount::fetchFullPlaylist( SpotifyPlaylistInfo* playlist )
|
||||||
{
|
{
|
||||||
@@ -406,7 +413,7 @@ SpotifyAccount::stopPlaylistSync( SpotifyPlaylistInfo* playlist )
|
|||||||
|
|
||||||
m_spotifyResolver.data()->sendMessage( msg );
|
m_spotifyResolver.data()->sendMessage( msg );
|
||||||
|
|
||||||
if ( deleteOnUnsync() )
|
if ( deleteOnUnsync() && m_updaters.contains( playlist->plid ) )
|
||||||
{
|
{
|
||||||
SpotifyPlaylistUpdater* updater = m_updaters.take( playlist->plid );
|
SpotifyPlaylistUpdater* updater = m_updaters.take( playlist->plid );
|
||||||
playlist_ptr tomahawkPl = updater->playlist();
|
playlist_ptr tomahawkPl = updater->playlist();
|
||||||
|
@@ -86,7 +86,9 @@ public:
|
|||||||
virtual SipPlugin* sipPlugin() { return 0; }
|
virtual SipPlugin* sipPlugin() { return 0; }
|
||||||
|
|
||||||
void sendMessage( const QVariantMap& msg, QObject* receiver, const QString& slot );
|
void sendMessage( const QVariantMap& msg, QObject* receiver, const QString& slot );
|
||||||
|
|
||||||
void registerUpdaterForPlaylist( const QString& plId, SpotifyPlaylistUpdater* updater );
|
void registerUpdaterForPlaylist( const QString& plId, SpotifyPlaylistUpdater* updater );
|
||||||
|
void unregisterUpdater( const QString& plid );
|
||||||
|
|
||||||
bool deleteOnUnsync() const;
|
bool deleteOnUnsync() const;
|
||||||
private slots:
|
private slots:
|
||||||
|
@@ -85,7 +85,10 @@ SpotifyPlaylistUpdater::init()
|
|||||||
|
|
||||||
SpotifyPlaylistUpdater::~SpotifyPlaylistUpdater()
|
SpotifyPlaylistUpdater::~SpotifyPlaylistUpdater()
|
||||||
{
|
{
|
||||||
|
if ( !m_spotify.isNull() )
|
||||||
|
{
|
||||||
|
m_spotify.data()->unregisterUpdater( m_spotifyId );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user