mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-21 05:11:44 +02:00
fix loading and saving of dynamic playlists, forgot to update the mode and type settings when setting a new revision
This commit is contained in:
@@ -141,4 +141,18 @@ DatabaseCommand_SetDynamicPlaylistRevision::exec( DatabaseImpl* lib )
|
|||||||
controlsQuery.exec();
|
controlsQuery.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( m_applied )
|
||||||
|
{
|
||||||
|
qDebug() << "updating dynamic playlist, optimistic locking okay";
|
||||||
|
|
||||||
|
TomahawkSqlQuery query2 = lib->newquery();
|
||||||
|
query2.prepare( "UPDATE dynamic_playlist SET pltype = ?, plmode = ? WHERE guid = ?" );
|
||||||
|
query2.bindValue( 0, m_type );
|
||||||
|
query2.bindValue( 1, m_mode );
|
||||||
|
query2.bindValue( 2, m_playlistguid );
|
||||||
|
query2.exec();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -316,9 +316,9 @@ void DynamicPlaylist::setRevision( const QString& rev,
|
|||||||
dpr.type = type;
|
dpr.type = type;
|
||||||
dpr.mode = Static;
|
dpr.mode = Static;
|
||||||
|
|
||||||
if( applied )
|
if( applied ) {
|
||||||
setCurrentrevision( rev );
|
setCurrentrevision( rev );
|
||||||
|
}
|
||||||
// qDebug() << "EMITTING REVISION LOADED 1!";
|
// qDebug() << "EMITTING REVISION LOADED 1!";
|
||||||
emit dynamicRevisionLoaded( dpr );
|
emit dynamicRevisionLoaded( dpr );
|
||||||
}
|
}
|
||||||
@@ -386,6 +386,9 @@ void DynamicPlaylist::setRevision( const QString& rev,
|
|||||||
dpr.type = type;
|
dpr.type = type;
|
||||||
dpr.mode = OnDemand;
|
dpr.mode = OnDemand;
|
||||||
|
|
||||||
|
if( applied ) {
|
||||||
|
setCurrentrevision( rev );
|
||||||
|
}
|
||||||
// qDebug() << "EMITTING REVISION LOADED 2!";
|
// qDebug() << "EMITTING REVISION LOADED 2!";
|
||||||
emit dynamicRevisionLoaded( dpr );
|
emit dynamicRevisionLoaded( dpr );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user