From cd5c1f3f454641b202e09c73edcb463c61d57995 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 13 Oct 2021 19:12:02 +0200 Subject: [PATCH] db/update/playlist: remove empty playlist directories --- src/db/update/Playlist.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/db/update/Playlist.cxx b/src/db/update/Playlist.cxx index 809fd39a4..f783b329f 100644 --- a/src/db/update/Playlist.cxx +++ b/src/db/update/Playlist.cxx @@ -94,6 +94,9 @@ UpdateWalk::UpdatePlaylistFile(Directory &parent, std::string_view name, directory->AddSong(std::move(db_song)); } } + + if (directory->IsEmpty()) + editor.LockDeleteDirectory(directory); } catch (...) { FmtError(update_domain, "Failed to scan playlist '{}': {}",