From fec1a4ac32c0f74fdf9f320f70e1fa0df31610bf Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Mon, 8 Jan 2024 13:53:20 +0100
Subject: [PATCH] db/simple: pass hide_playlist_targets to sub-instance

---
 src/db/plugins/simple/SimpleDatabasePlugin.cxx | 11 +++++++----
 src/db/plugins/simple/SimpleDatabasePlugin.hxx |  3 ++-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.cxx b/src/db/plugins/simple/SimpleDatabasePlugin.cxx
index 854861a59..be2a7e298 100644
--- a/src/db/plugins/simple/SimpleDatabasePlugin.cxx
+++ b/src/db/plugins/simple/SimpleDatabasePlugin.cxx
@@ -54,17 +54,20 @@ inline SimpleDatabase::SimpleDatabase(const ConfigBlock &block)
 	path_utf8 = path.ToUTF8();
 }
 
-inline SimpleDatabase::SimpleDatabase(AllocatedPath &&_path,
+inline
+SimpleDatabase::SimpleDatabase(AllocatedPath &&_path,
 #ifndef ENABLE_ZLIB
-				      [[maybe_unused]]
+			       [[maybe_unused]]
 #endif
-				      bool _compress) noexcept
+			       bool _compress,
+			       bool _hide_playlist_targets) noexcept
 	:Database(simple_db_plugin),
 	 path(std::move(_path)),
 	 path_utf8(path.ToUTF8()),
 #ifdef ENABLE_ZLIB
 	 compress(_compress),
 #endif
+	 hide_playlist_targets(_hide_playlist_targets),
 	 cache_path(nullptr)
 {
 }
@@ -426,7 +429,7 @@ SimpleDatabase::Mount(const char *local_uri, const char *storage_uri)
 	constexpr bool compress = false;
 #endif
 	auto db = std::make_unique<SimpleDatabase>(cache_path / name_fs,
-						   compress);
+						   compress, hide_playlist_targets);
 	db->Open();
 
 	bool exists = db->FileExists();
diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.hxx b/src/db/plugins/simple/SimpleDatabasePlugin.hxx
index 424fe835c..7df59f4bd 100644
--- a/src/db/plugins/simple/SimpleDatabasePlugin.hxx
+++ b/src/db/plugins/simple/SimpleDatabasePlugin.hxx
@@ -56,7 +56,8 @@ class SimpleDatabase : public Database {
 
 public:
 	SimpleDatabase(const ConfigBlock &block);
-	SimpleDatabase(AllocatedPath &&_path, bool _compress) noexcept;
+	SimpleDatabase(AllocatedPath &&_path, bool _compress,
+		       bool _hide_playlist_targets) noexcept;
 
 	static DatabasePtr Create(EventLoop &main_event_loop,
 				  EventLoop &io_event_loop,