From 6fd08bc8fad5d6c4be37ce751d53ef80b756b292 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 9 Oct 2008 19:11:54 +0200 Subject: update: don't export updateDirectory() If the user requests database update during startup, call directory_update_init(). This should be changed to fully asynchronous update later. For this to work, main_notify has to be initialized before db_init(). --- src/database.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/database.c') diff --git a/src/database.c b/src/database.c index 11de15bcc..3a1667bb6 100644 --- a/src/database.c +++ b/src/database.c @@ -39,7 +39,15 @@ static time_t directory_dbModTime; void db_init(void) { music_root = directory_new("", NULL); - updateDirectory(music_root); + + if (directory_update_init(NULL) < 0) + FATAL("directory update failed\n"); + + do { + my_usleep(100000); + reap_update_task(); + } while (isUpdatingDB()); + stats.numberOfSongs = countSongsIn(NULL); stats.dbPlayTime = sumSongTimesIn(NULL); } -- cgit v1.2.3