status: when updating playlist, deselect modified items
This commit is contained in:
@@ -416,16 +416,23 @@ void Status::Changes::playlist(unsigned previous_version)
|
||||
for (; s != end; ++s)
|
||||
{
|
||||
size_t pos = s->getPosition();
|
||||
myPlaylist->registerSong(*s);
|
||||
if (pos < myPlaylist->main().size())
|
||||
{
|
||||
// if song's already in playlist, replace it with a new one
|
||||
MPD::Song &old_s = myPlaylist->main()[pos].value();
|
||||
myPlaylist->unregisterSong(old_s);
|
||||
old_s = std::move(*s);
|
||||
if (old_s != *s)
|
||||
{
|
||||
myPlaylist->registerSong(*s);
|
||||
myPlaylist->unregisterSong(old_s);
|
||||
myPlaylist->main()[pos].setSelected(false);
|
||||
old_s = std::move(*s);
|
||||
}
|
||||
}
|
||||
else // otherwise just add it to playlist
|
||||
{
|
||||
myPlaylist->registerSong(*s);
|
||||
myPlaylist->main().addItem(std::move(*s));
|
||||
}
|
||||
}
|
||||
|
||||
myPlaylist->reloadTotalLength();
|
||||
|
||||
Reference in New Issue
Block a user