mapper: make the music_directory optional

Without a music_directory, MPD is an excellent streaming client.
This commit is contained in:
Max Kellermann
2009-01-18 16:56:07 +01:00
parent 9933144de7
commit 1f0dfb4407
8 changed files with 95 additions and 35 deletions

View File

@@ -128,7 +128,16 @@ static void openDB(Options * options, char *argv0)
{
struct config_param *param;
param = parseConfigFilePath(CONF_DB_FILE, true);
param = parseConfigFilePath(CONF_DB_FILE,
mapper_has_music_directory());
if (!mapper_has_music_directory()) {
if (param != NULL)
g_message("Found " CONF_DB_FILE " setting without "
CONF_MUSIC_DIR " - disabling database");
db_init(NULL);
return;
}
db_init(param->value);
if (options->createDB > 0 || !db_load()) {