Commit f9472746 authored by Max Kellermann's avatar Max Kellermann

InotifyUpdate: use class Storage instead of Mapper.cxx

parent f6939f71
...@@ -528,8 +528,11 @@ int mpd_main(int argc, char *argv[]) ...@@ -528,8 +528,11 @@ int mpd_main(int argc, char *argv[])
if (config_get_bool(CONF_AUTO_UPDATE, false)) { if (config_get_bool(CONF_AUTO_UPDATE, false)) {
#ifdef ENABLE_INOTIFY #ifdef ENABLE_INOTIFY
if (mapper_has_music_directory() && if (mapper_has_music_directory() &&
instance->storage != nullptr &&
instance->update != 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, config_get_unsigned(CONF_AUTO_UPDATE_DEPTH,
G_MAXUINT)); G_MAXUINT));
#else #else
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "InotifySource.hxx" #include "InotifySource.hxx"
#include "InotifyQueue.hxx" #include "InotifyQueue.hxx"
#include "InotifyDomain.hxx" #include "InotifyDomain.hxx"
#include "Mapper.hxx" #include "storage/StorageInterface.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx" #include "fs/FileSystem.hxx"
#include "util/Error.hxx" #include "util/Error.hxx"
...@@ -290,11 +290,12 @@ mpd_inotify_callback(int wd, unsigned mask, ...@@ -290,11 +290,12 @@ mpd_inotify_callback(int wd, unsigned mask,
} }
void 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"); LogDebug(inotify_domain, "initializing inotify");
const auto &path = mapper_get_music_directory_fs(); const auto path = storage.MapFS("");
if (path.IsNull()) { if (path.IsNull()) {
LogDebug(inotify_domain, "no music directory configured"); LogDebug(inotify_domain, "no music directory configured");
return; return;
......
...@@ -24,10 +24,12 @@ ...@@ -24,10 +24,12 @@
#include "Compiler.h" #include "Compiler.h"
class EventLoop; class EventLoop;
class Storage;
class UpdateService; class UpdateService;
void void
mpd_inotify_init(EventLoop &loop, UpdateService &update, unsigned max_depth); mpd_inotify_init(EventLoop &loop, Storage &storage, UpdateService &update,
unsigned max_depth);
void void
mpd_inotify_finish(void); mpd_inotify_finish(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment