mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-13 17:16:42 +02:00
Host: added update function
This commit is contained in:
parent
5cc3c157a7
commit
cc057eef29
2 changed files with 9 additions and 1 deletions
|
@ -71,10 +71,17 @@ struct Volume
|
|||
|
||||
struct Host
|
||||
{
|
||||
Host(const std::string& _macAddress = "") : name(getHostName()), mac(_macAddress), os(getOS()), arch(getArch()), ip("")
|
||||
Host(const std::string& _macAddress = "") : name(""), mac(_macAddress), os(""), arch(""), ip("")
|
||||
{
|
||||
}
|
||||
|
||||
void update()
|
||||
{
|
||||
name = getHostName();
|
||||
os = getOS();
|
||||
arch = getArch();
|
||||
}
|
||||
|
||||
void fromJson(const json& j)
|
||||
{
|
||||
name = trim_copy(jGet<std::string>(j, "name", ""));
|
||||
|
|
|
@ -147,6 +147,7 @@ void StreamServer::onMessageReceived(ControlSession* controlSession, const std::
|
|||
jClient = Config::instance().getClientInfos();
|
||||
|
||||
Host host;
|
||||
host.update();
|
||||
//TODO: Set MAC and IP
|
||||
Snapserver snapserver("Snapserver", VERSION);
|
||||
response = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue