Commit 8d631b34 authored by Max Kellermann's avatar Max Kellermann

inotify_update: start update when directory is created

This is useful at the maximum depth level, to update newly created directories. It is however questionable if the hard-coded 5 seconds delay is enough to create new directory trees with all of their files, but we might make that delay configurable in the future.
parent 393bcd96
......@@ -275,8 +275,12 @@ mpd_inotify_callback(int wd, unsigned mask,
g_free(path_fs);
}
if ((mask & (IN_CLOSE_WRITE|IN_MOVE|IN_DELETE)) != 0) {
/* a file was changed, or a direectory was
if ((mask & (IN_CLOSE_WRITE|IN_MOVE|IN_DELETE)) != 0 ||
/* at the maximum depth, we watch out for newly created
directories */
(watch_directory_depth(directory) == inotify_max_depth &&
(mask & (IN_CREATE|IN_ISDIR)) == (IN_CREATE|IN_ISDIR))) {
/* a file was changed, or a directory was
moved/deleted: queue a database update */
char *uri_utf8 = uri_fs != NULL
? fs_charset_to_utf8(uri_fs)
......
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