diff options
author | Max Kellermann <max@duempel.org> | 2009-09-25 18:32:00 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-09-25 18:32:00 +0200 |
commit | 8f261af5c1cfd6f922df009e17756fa3bef71458 (patch) | |
tree | dd5dd4bd6d41d1536e31f32e502e473e40520663 /src/main.c | |
parent | 3e8bdb93844eb21f4a34d4f586e51f869933ebb8 (diff) | |
download | mpd-8f261af5c1cfd6f922df009e17756fa3bef71458.tar.gz mpd-8f261af5c1cfd6f922df009e17756fa3bef71458.tar.xz mpd-8f261af5c1cfd6f922df009e17756fa3bef71458.zip |
automatically update the database with Linux inotify
This patch implements a light-weight inotify library, and watches all
directories below the music directory. It updates all directories
where files changed after a delay of 5 seconds.
Diffstat (limited to '')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index 56627b665..bb0d09eaf 100644 --- a/src/main.c +++ b/src/main.c @@ -55,6 +55,7 @@ #include "dirvec.h" #include "songvec.h" #include "tag_pool.h" +#include "inotify_update.h" #ifdef ENABLE_SQLITE #include "sticker.h" @@ -369,6 +370,9 @@ int main(int argc, char *argv[]) glue_state_file_init(); + if (mapper_has_music_directory()) + mpd_inotify_init(); + config_global_check(); /* run the main loop */ @@ -379,6 +383,8 @@ int main(int argc, char *argv[]) g_main_loop_unref(main_loop); + mpd_inotify_finish(); + state_file_finish(); playerKill(); finishZeroconf(); |