aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/database.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c
index 93d0d7ef8..bd069f8b4 100644
--- a/src/database.c
+++ b/src/database.c
@@ -29,6 +29,7 @@
#include "utils.h"
#include "dbUtils.h"
#include "update.h"
+#include "main_notify.h"
#include <assert.h>
#include <string.h>
@@ -40,8 +41,19 @@ static time_t directory_dbModTime;
void
db_init(void)
{
+ int ret;
+
music_root = directory_new("", NULL);
- updateDirectory(music_root);
+
+ ret = directory_update_init(NULL);
+ if (ret < 0)
+ FATAL("directory update failed\n");
+
+ do {
+ wait_main_task();
+ reap_update_task();
+ } while (isUpdatingDB());
+
stats.numberOfSongs = countSongsIn(NULL);
stats.dbPlayTime = sumSongTimesIn(NULL);
}