From 5d2e80f188038a6cd388d8ec6647a809243153a4 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Mon, 28 Nov 2022 13:54:40 +0100
Subject: [PATCH] db/Configured: use GetAppCacheDir() instead of
 GetUserCacheDir()

---
 NEWS                  | 2 ++
 src/db/Configured.cxx | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 1eec3f592..5c2c091da 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
 ver 0.23.11 (not yet released)
+* database
+  - simple: move default database to ~/.cache/mpd/db from ~/.cache/mpd.db
 * macOS: fix build failure "no archive members specified"
 * Windows
   - fix crash bug (stack buffer overflow) after I/O errors
diff --git a/src/db/Configured.cxx b/src/db/Configured.cxx
index 0ae9f0d11..fc4e2c328 100644
--- a/src/db/Configured.cxx
+++ b/src/db/Configured.cxx
@@ -51,11 +51,11 @@ CreateConfiguredDatabase(const ConfigData &config,
 	} else {
 		/* if there is no override, use the cache directory */
 
-		const AllocatedPath cache_dir = GetUserCacheDir();
+		const AllocatedPath cache_dir = GetAppCacheDir();
 		if (cache_dir.IsNull())
 			return nullptr;
 
-		const auto db_file = cache_dir / Path::FromFS(PATH_LITERAL("mpd.db"));
+		const auto db_file = cache_dir / Path::FromFS(PATH_LITERAL("db"));
 		auto db_file_utf8 = db_file.ToUTF8();
 		if (db_file_utf8.empty())
 			return nullptr;