Fix for "Mount-Points are purged from database on update/rescan."

Signed-off-by: FlashSystems <developer@flashsystems.de>
This commit is contained in:
FlashSystems 2017-11-25 12:24:27 +01:00 committed by Max Kellermann
parent 53def9a682
commit 63fc98591d
3 changed files with 4 additions and 2 deletions

2
NEWS
View File

@ -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

View File

@ -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

View File

@ -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);