summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlashSystems <developer@flashsystems.de>2017-11-25 12:24:27 +0100
committerMax Kellermann <max@musicpd.org>2017-11-27 22:34:49 +0100
commit63fc98591d9be2ee4f1ef11965f7eb0717689d68 (patch)
tree3dbbb2b6236d16941abd08d138728d1268ec0513
parent53def9a6824fdf6f4aea969fd3b28eff563dceec (diff)
Fix for "Mount-Points are purged from database on update/rescan."
Signed-off-by: FlashSystems <developer@flashsystems.de>
-rw-r--r--NEWS2
-rw-r--r--src/db/plugins/simple/Directory.cxx2
-rw-r--r--src/db/update/Walk.cxx2
3 files changed, 4 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 266c11e38..d82e2b19d 100644
--- a/NEWS
+++ b/NEWS
@@ -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);