diff options
Diffstat (limited to '')
-rw-r--r-- | src/Main.cxx | 5 | ||||
-rw-r--r-- | src/db/update/InotifyUpdate.cxx | 7 | ||||
-rw-r--r-- | src/db/update/InotifyUpdate.hxx | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index 8e0b92d9c..e2bcaf4ec 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -528,8 +528,11 @@ int mpd_main(int argc, char *argv[]) if (config_get_bool(CONF_AUTO_UPDATE, false)) { #ifdef ENABLE_INOTIFY if (mapper_has_music_directory() && + instance->storage != nullptr && instance->update != nullptr) - mpd_inotify_init(*instance->event_loop, *instance->update, + mpd_inotify_init(*instance->event_loop, + *instance->storage, + *instance->update, config_get_unsigned(CONF_AUTO_UPDATE_DEPTH, G_MAXUINT)); #else diff --git a/src/db/update/InotifyUpdate.cxx b/src/db/update/InotifyUpdate.cxx index 0ccd19896..26bdddf8d 100644 --- a/src/db/update/InotifyUpdate.cxx +++ b/src/db/update/InotifyUpdate.cxx @@ -22,7 +22,7 @@ #include "InotifySource.hxx" #include "InotifyQueue.hxx" #include "InotifyDomain.hxx" -#include "Mapper.hxx" +#include "storage/StorageInterface.hxx" #include "fs/AllocatedPath.hxx" #include "fs/FileSystem.hxx" #include "util/Error.hxx" @@ -290,11 +290,12 @@ mpd_inotify_callback(int wd, unsigned mask, } void -mpd_inotify_init(EventLoop &loop, UpdateService &update, unsigned max_depth) +mpd_inotify_init(EventLoop &loop, Storage &storage, UpdateService &update, + unsigned max_depth) { LogDebug(inotify_domain, "initializing inotify"); - const auto &path = mapper_get_music_directory_fs(); + const auto path = storage.MapFS(""); if (path.IsNull()) { LogDebug(inotify_domain, "no music directory configured"); return; diff --git a/src/db/update/InotifyUpdate.hxx b/src/db/update/InotifyUpdate.hxx index d378770c0..0f78db71f 100644 --- a/src/db/update/InotifyUpdate.hxx +++ b/src/db/update/InotifyUpdate.hxx @@ -24,10 +24,12 @@ #include "Compiler.h" class EventLoop; +class Storage; class UpdateService; void -mpd_inotify_init(EventLoop &loop, UpdateService &update, unsigned max_depth); +mpd_inotify_init(EventLoop &loop, Storage &storage, UpdateService &update, + unsigned max_depth); void mpd_inotify_finish(void); |