diff options
author | FlashSystems <developer@flashsystems.de> | 2017-11-25 12:24:27 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-11-27 22:34:49 +0100 |
commit | 63fc98591d9be2ee4f1ef11965f7eb0717689d68 (patch) | |
tree | 3dbbb2b6236d16941abd08d138728d1268ec0513 | |
parent | 53def9a6824fdf6f4aea969fd3b28eff563dceec (diff) |
Fix for "Mount-Points are purged from database on update/rescan."
Signed-off-by: FlashSystems <developer@flashsystems.de>
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/db/plugins/simple/Directory.cxx | 2 | ||||
-rw-r--r-- | src/db/update/Walk.cxx | 2 |
3 files changed, 4 insertions, 2 deletions
@@ -1,4 +1,6 @@ ver 0.20.13 (not yet released) +* database + - simple: don't purge mount points on update/rescan ver 0.20.12 (2017/11/25) * database diff --git a/src/db/plugins/simple/Directory.cxx b/src/db/plugins/simple/Directory.cxx index 655778b99..30b044b1f 100644 --- a/src/db/plugins/simple/Directory.cxx +++ b/src/db/plugins/simple/Directory.cxx @@ -109,7 +109,7 @@ Directory::PruneEmpty() noexcept child != end;) { child->PruneEmpty(); - if (child->IsEmpty()) + if (child->IsEmpty() && !child->IsMount()) child = children.erase_and_dispose(child, DeleteDisposer()); else diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx index c3af3f789..1ef37e4d1 100644 --- a/src/db/update/Walk.cxx +++ b/src/db/update/Walk.cxx @@ -104,7 +104,7 @@ inline void UpdateWalk::PurgeDeletedFromDirectory(Directory &directory) { directory.ForEachChildSafe([&](Directory &child){ - if (DirectoryExists(storage, child)) + if (child.IsMount() || DirectoryExists(storage, child)) return; editor.LockDeleteDirectory(&child); |