Check error status of command to start playing file.

master
Tom Alexander 2 years ago
parent eb9bfb7862
commit 60d2afd10d
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -140,6 +140,12 @@ impl MpvCtl {
let cmd_result = self.send_command(cmd).await?;
let result = cmd_result.await?;
if let serde_json::Value::Object(obj) = result {
match obj.get("error") {
Some(status) if status == "success" => (),
_ => {
return Err("Non-success status".into());
}
};
return Ok(());
} else {
return Err("Did not get back an object".into());

Loading…
Cancel
Save