db/update/Walk: clear Song::in_playlist

Without clearing all `in_playlist` flags, the songs will never be
revealed again if they were hidden once by a CUE sheet, not even after
the CUE sheet gets deleted or modified.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1784
This commit is contained in:
Max Kellermann
2023-05-22 15:41:20 +02:00
parent dc127f39a7
commit 068cd559e1
4 changed files with 23 additions and 0 deletions

View File

@@ -126,6 +126,18 @@ Directory::LookupTargetSong(std::string_view _target) noexcept
return lr.directory->FindSong(lr.rest);
}
void
Directory::ClearInPlaylist() noexcept
{
assert(holding_db_lock());
for (auto &child : children)
child.ClearInPlaylist();
for (auto &song : songs)
song.in_playlist = false;
}
void
Directory::PruneEmpty() noexcept
{