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();
}
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();

View File

@ -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,