diff options
author | Max Kellermann <max@duempel.org> | 2014-01-31 22:17:49 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-31 22:17:49 +0100 |
commit | 26970579b86c4dfb8e7a11cbc12edac670e4f0e2 (patch) | |
tree | 4f859ab8b534fb3d2fc637624cc4c412797a1efd /src/db/update/Walk.cxx | |
parent | 04b4f534889719fd822aff5cf9b78a50d1da47ad (diff) | |
download | mpd-26970579b86c4dfb8e7a11cbc12edac670e4f0e2.tar.gz mpd-26970579b86c4dfb8e7a11cbc12edac670e4f0e2.tar.xz mpd-26970579b86c4dfb8e7a11cbc12edac670e4f0e2.zip |
db/update/Editor: add locking method variants
Diffstat (limited to 'src/db/update/Walk.cxx')
-rw-r--r-- | src/db/update/Walk.cxx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx index 1ca589456..ff59fe960 100644 --- a/src/db/update/Walk.cxx +++ b/src/db/update/Walk.cxx @@ -107,9 +107,7 @@ UpdateWalk::PurgeDeletedFromDirectory(Directory &directory) if (directory_exists(*child)) continue; - db_lock(); - editor.DeleteDirectory(child); - db_unlock(); + editor.LockDeleteDirectory(child); modified = true; } @@ -118,9 +116,7 @@ UpdateWalk::PurgeDeletedFromDirectory(Directory &directory) directory_for_each_song_safe(song, ns, directory) { const auto path = map_song_fs(*song); if (path.IsNull() || !FileExists(path)) { - db_lock(); - editor.DeleteSong(directory, song); - db_unlock(); + editor.LockDeleteSong(directory, song); modified = true; } @@ -223,11 +219,8 @@ UpdateWalk::UpdateDirectoryChild(Directory &directory, assert(&directory == subdir->parent); - if (!UpdateDirectory(*subdir, st)) { - db_lock(); - editor.DeleteDirectory(subdir); - db_unlock(); - } + if (!UpdateDirectory(*subdir, st)) + editor.LockDeleteDirectory(subdir); } else { FormatDebug(update_domain, "%s is not a directory, archive or music", name); |