From 63fc98591d9be2ee4f1ef11965f7eb0717689d68 Mon Sep 17 00:00:00 2001 From: FlashSystems Date: Sat, 25 Nov 2017 12:24:27 +0100 Subject: Fix for "Mount-Points are purged from database on update/rescan." Signed-off-by: FlashSystems --- NEWS | 2 ++ src/db/plugins/simple/Directory.cxx | 2 +- src/db/update/Walk.cxx | 2 +- 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); -- cgit v1.2.3