mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Add a health check method to player
This commit is contained in:
parent
46195f18d6
commit
ddadcc9ea0
1 changed files with 7 additions and 0 deletions
|
@ -495,6 +495,13 @@ impl Player {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_invalid(&self) -> bool {
|
||||||
|
if let Some(handle) = self.thread_handle.as_ref() {
|
||||||
|
return handle.is_finished();
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
fn command(&self, cmd: PlayerCommand) {
|
fn command(&self, cmd: PlayerCommand) {
|
||||||
if let Some(commands) = self.commands.as_ref() {
|
if let Some(commands) = self.commands.as_ref() {
|
||||||
if let Err(e) = commands.send(cmd) {
|
if let Err(e) = commands.send(cmd) {
|
||||||
|
|
Loading…
Reference in a new issue