mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-08 12:17:57 +02:00
Communicate via stdin/stdout with ctrl script
This commit is contained in:
parent
91ea368121
commit
6e6b63ec26
5 changed files with 226 additions and 82 deletions
|
@ -438,7 +438,7 @@ void Server::processRequest(const jsonrpcpp::request_ptr request, jsonrpcpp::ent
|
|||
// clang-format on
|
||||
|
||||
LOG(INFO, LOG_TAG) << "Stream.Control id: " << request->params().get<std::string>("id") << ", command: " << request->params().get("command")
|
||||
<< "\n";
|
||||
<< ", params: " << (request->params().has("params") ? request->params().get("params") : "") << "\n";
|
||||
|
||||
// Find stream
|
||||
string streamId = request->params().get<std::string>("id");
|
||||
|
@ -447,7 +447,7 @@ void Server::processRequest(const jsonrpcpp::request_ptr request, jsonrpcpp::ent
|
|||
throw jsonrpcpp::InternalErrorException("Stream not found", request->id());
|
||||
|
||||
// Set metadata from request
|
||||
stream->control(request->params().get("command"), request->params().has("param") ? request->params().get("param") : "");
|
||||
stream->control(request->params().get("command"), request->params().has("params") ? request->params().get("params") : json{});
|
||||
|
||||
// Setup response
|
||||
result["id"] = streamId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue