Commit e9f6a348 authored by Max Kellermann's avatar Max Kellermann

db/Configured: add default "cache_directory" setting

parent 5d2e80f1
ver 0.23.11 (not yet released)
* database
- simple: move default database to ~/.cache/mpd/db from ~/.cache/mpd.db
- simple: default "cache_directory" to ~/.cache/mpd/mounts
* macOS: fix build failure "no archive members specified"
* Windows
- fix crash bug (stack buffer overflow) after I/O errors
......
......@@ -24,6 +24,7 @@
#include "config/Param.hxx"
#include "config/Block.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
#include "fs/StandardDirectory.hxx"
#include "util/RuntimeError.hxx"
......@@ -62,6 +63,19 @@ CreateConfiguredDatabase(const ConfigData &config,
ConfigBlock block;
block.AddBlockParam("path", std::move(db_file_utf8), -1);
{
const auto mounts_dir = cache_dir
/ Path::FromFS(PATH_LITERAL("mounts"));
CreateDirectoryNoThrow(mounts_dir);
if (auto mounts_dir_utf8 = mounts_dir.ToUTF8();
!mounts_dir_utf8.empty())
block.AddBlockParam("cache_directory",
std::move(mounts_dir_utf8),
-1);
}
return DatabaseGlobalInit(main_event_loop, io_event_loop,
listener, block);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment