db/simple: purge songs for unavailable decoder plugins on update

This commit is contained in:
Max Kellermann
2020-10-28 14:24:44 +01:00
parent bf97d13d0b
commit bbfa6fe632
5 changed files with 34 additions and 2 deletions

View File

@@ -111,7 +111,11 @@ UpdateWalk::PurgeDeletedFromDirectory(Directory &directory) noexcept
directory.ForEachSongSafe([&](Song &song){
if (!directory_child_is_regular(storage, directory,
song.filename)) {
song.filename) ||
!song.IsPluginAvailable()) {
/* the song file was deleted (or the decoder
plugin is unavailable) */
editor.LockDeleteSong(directory, &song);
modified = true;