From ae85c2a9793b1755ca11cd4e7ccc6125f0dc7e08 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 16 Apr 2024 10:54:50 +0200 Subject: [PATCH] db/Configured: log debug message when there is no cache directory Closes https://github.com/MusicPlayerDaemon/MPD/issues/1525 --- src/db/Configured.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/db/Configured.cxx b/src/db/Configured.cxx index 7c6864eb8..b630f39ec 100644 --- a/src/db/Configured.cxx +++ b/src/db/Configured.cxx @@ -5,12 +5,14 @@ #include "DatabaseGlue.hxx" #include "Interface.hxx" #include "config/Data.hxx" +#include "config/Domain.hxx" #include "config/Param.hxx" #include "config/Block.hxx" #include "fs/AllocatedPath.hxx" #include "fs/FileSystem.hxx" #include "fs/glue/StandardDirectory.hxx" #include "lib/fmt/RuntimeError.hxx" +#include "Log.hxx" DatabasePtr CreateConfiguredDatabase(const ConfigData &config, @@ -37,8 +39,10 @@ CreateConfiguredDatabase(const ConfigData &config, /* if there is no override, use the cache directory */ const AllocatedPath cache_dir = GetAppCacheDir(); - if (cache_dir.IsNull()) + if (cache_dir.IsNull()) { + FmtDebug(config_domain, "No cache directory; disabling the database"); return nullptr; + } const auto db_file = cache_dir / Path::FromFS(PATH_LITERAL("db")); auto db_file_utf8 = db_file.ToUTF8();