feat: get daemon's version using pwsp-cli

pwsp-cli get daemon-version
This commit is contained in:
2026-02-14 15:43:17 +03:00
parent 23ae562849
commit b816d2aa88
4 changed files with 18 additions and 1 deletions
+10 -1
View File
@@ -82,6 +82,8 @@ pub struct ToggleLoopCommand {
pub id: Option<u32>,
}
pub struct GetDaemonVersionCommand {}
pub struct GetFullStateCommand {}
#[async_trait]
@@ -347,6 +349,13 @@ impl Executable for ToggleLoopCommand {
}
}
#[async_trait]
impl Executable for GetDaemonVersionCommand {
async fn execute(&self) -> Response {
Response::new(true, env!("CARGO_PKG_VERSION"))
}
}
#[async_trait]
impl Executable for GetFullStateCommand {
async fn execute(&self) -> Response {
@@ -374,7 +383,7 @@ impl Executable for GetFullStateCommand {
tracks: audio_player.get_tracks(),
volume: audio_player.volume,
current_input: current_input_nick,
all_inputs,
all_inputs: all_inputs,
};
Response::new(true, serde_json::to_string(&full_state).unwrap())
+4
View File
@@ -156,6 +156,10 @@ impl Request {
Request::new("toggle_loop", args)
}
pub fn get_daemon_version() -> Self {
Request::new("get_daemon_version", vec![])
}
pub fn get_full_state() -> Self {
Request::new("get_full_state", vec![])
}