mirror of
https://github.com/badaix/snapcast.git
synced 2025-04-29 18:27:12 +02:00
added ConfigVersion
This commit is contained in:
parent
ca3a12a8d4
commit
5951c123c9
1 changed files with 11 additions and 7 deletions
|
@ -48,14 +48,17 @@ Config::Config()
|
||||||
{
|
{
|
||||||
json j;
|
json j;
|
||||||
ifs >> j;
|
ifs >> j;
|
||||||
json jClient = j["Client"];
|
if (j.count("ConfigVersion"))
|
||||||
for (json::iterator it = jClient.begin(); it != jClient.end(); ++it)
|
|
||||||
{
|
{
|
||||||
ClientInfoPtr client = make_shared<ClientInfo>();
|
json jClient = j["Client"];
|
||||||
client->fromJson(*it);
|
for (json::iterator it = jClient.begin(); it != jClient.end(); ++it)
|
||||||
client->connected = false;
|
{
|
||||||
clients.push_back(client);
|
ClientInfoPtr client = make_shared<ClientInfo>();
|
||||||
// logO << "Client:\n" << std::setw(4) << client->toJson() << '\n';
|
client->fromJson(*it);
|
||||||
|
client->connected = false;
|
||||||
|
clients.push_back(client);
|
||||||
|
// logO << "Client:\n" << std::setw(4) << client->toJson() << '\n';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,6 +73,7 @@ void Config::save()
|
||||||
{
|
{
|
||||||
std::ofstream ofs(filename_.c_str(), std::ofstream::out|std::ofstream::trunc);
|
std::ofstream ofs(filename_.c_str(), std::ofstream::out|std::ofstream::trunc);
|
||||||
json clients = {
|
json clients = {
|
||||||
|
{"ConfigVersion", 1},
|
||||||
{"Client", getClientInfos()}
|
{"Client", getClientInfos()}
|
||||||
};
|
};
|
||||||
ofs << std::setw(4) << clients;
|
ofs << std::setw(4) << clients;
|
||||||
|
|
Loading…
Add table
Reference in a new issue