diff --git a/client/player/player.hpp b/client/player/player.hpp index 91159cb0..4e49782f 100644 --- a/client/player/player.hpp +++ b/client/player/player.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2024 Johannes Pohl + Copyright (C) 2014-2025 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ public: struct Volume { double volume{1.0}; ///< volume [0..1] - bool mute{false}; ///< muted? + bool mute{false}; ///< muted? }; using volume_callback = std::function; diff --git a/control/scripts.md b/control/scripts.md index 05b50224..be6f39d9 100644 --- a/control/scripts.md +++ b/control/scripts.md @@ -17,6 +17,7 @@ curl --header "Content-Type: application/json" --request POST --data '{"id":7,"j ``` ### Remove all disconnected clients + ```bash curl -s -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "Server.GetStatus"}' http://127.0.0.1:1780/jsonrpc | jq '.result.server.groups[].clients[] | select(.connected==false) .id' | while read ln; do curl -s -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "Server.DeleteClient", "params": {"id":'$ln'}}' http://127.0.0.1:1780/jsonrpc; done ``` diff --git a/server/control_requests.hpp b/server/control_requests.hpp index e727e504..a536b592 100644 --- a/server/control_requests.hpp +++ b/server/control_requests.hpp @@ -43,6 +43,7 @@ public: struct Description { /// c'tor + // NOLINTNEXTLINE Description(std::string description, std::vector> parameters = {}, std::string result = "") : description(std::move(description)), parameters(std::move(parameters)), result(std::move(result)) { diff --git a/server/stream_server.cpp b/server/stream_server.cpp index fbfbd86e..9fa30482 100644 --- a/server/stream_server.cpp +++ b/server/stream_server.cpp @@ -57,14 +57,14 @@ void StreamServer::cleanup() } -void StreamServer::addSession(const std::shared_ptr& session) +void StreamServer::addSession(std::shared_ptr session) { session->setMessageReceiver(this); session->setBufferMs(settings_.stream.bufferMs); session->start(); std::lock_guard mlock(sessionsMutex_); - sessions_.emplace_back(session); + sessions_.emplace_back(std::move(session)); cleanup(); } @@ -210,7 +210,7 @@ void StreamServer::handleAccept(tcp::socket socket) LOG(NOTICE, LOG_TAG) << "StreamServer::NewConnection: " << socket.remote_endpoint().address().to_string() << "\n"; shared_ptr session = make_shared(this, settings_, std::move(socket)); - addSession(session); + addSession(std::move(session)); } catch (const std::exception& e) { diff --git a/server/stream_server.hpp b/server/stream_server.hpp index db1a4dca..283fbdaa 100644 --- a/server/stream_server.hpp +++ b/server/stream_server.hpp @@ -67,7 +67,7 @@ public: // void send(const msg::BaseMessage* message); /// Add a new stream session - void addSession(const std::shared_ptr& session); + void addSession(std::shared_ptr session); /// Callback for chunks that are ready to be sent void onChunkEncoded(const PcmStream* pcmStream, bool isDefaultStream, const std::shared_ptr& chunk, double duration);