Check error status of command to start playing file.
This commit is contained in:
parent
eb9bfb7862
commit
60d2afd10d
@ -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…
x
Reference in New Issue
Block a user