aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index b7e9e0106..1bcae8f36 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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()) {