db: add compile-time option to disable database

This commit is contained in:
Max Kellermann
2014-01-30 20:29:48 +01:00
parent 34b309b99a
commit 4465e2c46b
25 changed files with 297 additions and 57 deletions

View File

@@ -74,11 +74,16 @@ handle_add(Client &client, gcc_unused int argc, char *argv[])
return print_playlist_result(client, result);
}
#ifdef ENABLE_DATABASE
const DatabaseSelection selection(uri, true);
Error error;
return AddFromDatabase(client.partition, selection, error)
? CommandResult::OK
: print_error(client, error);
#else
command_error(client, ACK_ERROR_NO_EXIST, "No database");
return CommandResult::ERROR;
#endif
}
CommandResult