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.
This commit is contained in:
Max Kellermann
2009-09-25 18:32:00 +02:00
parent 3e8bdb9384
commit 8f261af5c1
10 changed files with 806 additions and 0 deletions

View File

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