database: db_init() initializes library, does not update
For updating the database, directory_update_init() should be called explicitly.
This commit is contained in:
@@ -22,10 +22,8 @@
|
||||
#include "directory_save.h"
|
||||
#include "song.h"
|
||||
#include "conf.h"
|
||||
#include "ls.h"
|
||||
#include "path.h"
|
||||
#include "stats.h"
|
||||
#include "update.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
@@ -48,13 +46,7 @@ static time_t directory_dbModTime;
|
||||
void
|
||||
db_init(void)
|
||||
{
|
||||
unsigned ret;
|
||||
|
||||
music_root = directory_new("", NULL);
|
||||
|
||||
ret = directory_update_init(NULL);
|
||||
if (ret == 0)
|
||||
g_error("directory update failed");
|
||||
}
|
||||
|
||||
void
|
||||
@@ -256,6 +248,8 @@ db_load(void)
|
||||
int foundFsCharset = 0;
|
||||
int foundVersion = 0;
|
||||
|
||||
assert(music_root != NULL);
|
||||
|
||||
if (!music_root)
|
||||
music_root = directory_new("", NULL);
|
||||
while (!(fp = fopen(dbFile, "r")) && errno == EINTR) ;
|
||||
|
||||
Reference in New Issue
Block a user