mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-07 19:57:43 +02:00
Change Stream.SetProperties to Stream.SetProperty
This commit is contained in:
parent
5b9321b8c6
commit
bba3968f50
6 changed files with 102 additions and 65 deletions
|
@ -463,13 +463,13 @@ void Server::processRequest(const jsonrpcpp::request_ptr request, jsonrpcpp::ent
|
|||
// Setup response
|
||||
result["id"] = streamId;
|
||||
}
|
||||
else if (request->method().find("Stream.SetProperties") == 0)
|
||||
else if (request->method().find("Stream.SetProperty") == 0)
|
||||
{
|
||||
// clang-format off
|
||||
// clang-format on
|
||||
|
||||
LOG(INFO, LOG_TAG) << "Stream.SetProperties id: " << request->params().get<std::string>("id")
|
||||
<< ", properties: " << request->params().get("properties") << "\n";
|
||||
LOG(INFO, LOG_TAG) << "Stream.SetProperty id: " << request->params().get<std::string>("id")
|
||||
<< ", property: " << request->params().get("property") << ", value: " << request->params().get("value") << "\n";
|
||||
|
||||
// Find stream
|
||||
string streamId = request->params().get<std::string>("id");
|
||||
|
@ -477,12 +477,10 @@ void Server::processRequest(const jsonrpcpp::request_ptr request, jsonrpcpp::ent
|
|||
if (stream == nullptr)
|
||||
throw jsonrpcpp::InternalErrorException("Stream not found", request->id());
|
||||
|
||||
Properties props(request->params().get("properties"));
|
||||
|
||||
// Set metadata from request
|
||||
stream->setProperties(props);
|
||||
stream->setProperty(request->params().get("property"), request->params().get("value"));
|
||||
|
||||
// Setup response
|
||||
// TODO: error handling
|
||||
result["id"] = streamId;
|
||||
}
|
||||
else if (request->method() == "Stream.AddStream")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue