db/simple: pass hide_playlist_targets to sub-instance

This commit is contained in:
Max Kellermann 2024-01-08 13:53:20 +01:00
parent 7f439b01a3
commit fec1a4ac32
2 changed files with 9 additions and 5 deletions

View File

@ -54,17 +54,20 @@ inline SimpleDatabase::SimpleDatabase(const ConfigBlock &block)
path_utf8 = path.ToUTF8(); path_utf8 = path.ToUTF8();
} }
inline SimpleDatabase::SimpleDatabase(AllocatedPath &&_path, inline
SimpleDatabase::SimpleDatabase(AllocatedPath &&_path,
#ifndef ENABLE_ZLIB #ifndef ENABLE_ZLIB
[[maybe_unused]] [[maybe_unused]]
#endif #endif
bool _compress) noexcept bool _compress,
bool _hide_playlist_targets) noexcept
:Database(simple_db_plugin), :Database(simple_db_plugin),
path(std::move(_path)), path(std::move(_path)),
path_utf8(path.ToUTF8()), path_utf8(path.ToUTF8()),
#ifdef ENABLE_ZLIB #ifdef ENABLE_ZLIB
compress(_compress), compress(_compress),
#endif #endif
hide_playlist_targets(_hide_playlist_targets),
cache_path(nullptr) cache_path(nullptr)
{ {
} }
@ -426,7 +429,7 @@ SimpleDatabase::Mount(const char *local_uri, const char *storage_uri)
constexpr bool compress = false; constexpr bool compress = false;
#endif #endif
auto db = std::make_unique<SimpleDatabase>(cache_path / name_fs, auto db = std::make_unique<SimpleDatabase>(cache_path / name_fs,
compress); compress, hide_playlist_targets);
db->Open(); db->Open();
bool exists = db->FileExists(); bool exists = db->FileExists();

View File

@ -56,7 +56,8 @@ class SimpleDatabase : public Database {
public: public:
SimpleDatabase(const ConfigBlock &block); 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, static DatabasePtr Create(EventLoop &main_event_loop,
EventLoop &io_event_loop, EventLoop &io_event_loop,