mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-29 17:06:18 +02:00
identify client by id instead of MAC
This commit is contained in:
parent
433a2ff252
commit
9ec135e1b8
7 changed files with 61 additions and 50 deletions
|
@ -89,21 +89,21 @@ void Config::save()
|
|||
}
|
||||
|
||||
|
||||
ClientInfoPtr Config::getClientInfo(const std::string& macAddress, bool add)
|
||||
ClientInfoPtr Config::getClientInfo(const std::string& clientId, bool add)
|
||||
{
|
||||
if (macAddress.empty())
|
||||
if (clientId.empty())
|
||||
return nullptr;
|
||||
|
||||
for (auto client: clients)
|
||||
{
|
||||
if (client->host.mac == macAddress)
|
||||
if (client->clientId == clientId)
|
||||
return client;
|
||||
}
|
||||
|
||||
if (!add)
|
||||
return nullptr;
|
||||
|
||||
ClientInfoPtr client = make_shared<ClientInfo>(macAddress);
|
||||
ClientInfoPtr client = make_shared<ClientInfo>(clientId);
|
||||
clients.push_back(client);
|
||||
|
||||
return client;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue