mirror of
https://github.com/Dummi26/musicdb.git
synced 2025-03-10 14:13:53 +01:00
fix playback bug
This commit is contained in:
parent
14660b6dae
commit
c03c35f1c9
@ -88,28 +88,25 @@ impl<T> PlayerBackend<T> for PlayerBackendPlaybackRs<T> {
|
|||||||
}
|
}
|
||||||
fn next(&mut self, play: bool, _load_duration: bool) {
|
fn next(&mut self, play: bool, _load_duration: bool) {
|
||||||
self.pause();
|
self.pause();
|
||||||
|
self.player.stop();
|
||||||
self.player.skip();
|
self.player.skip();
|
||||||
self.current = self.next.take();
|
self.current = self.next.take();
|
||||||
if self.player.has_current_song() {
|
if let Some((id, song, _)) = &self.current {
|
||||||
self.player.set_playing(play);
|
if let Some(song) = song {
|
||||||
} else {
|
if let Err(e) = self.player.play_song_now(song, None) {
|
||||||
if let Some((id, song, _)) = &self.current {
|
if let Some(s) = &self.command_sender {
|
||||||
if let Some(song) = song {
|
s.send(Command::ErrorInfo(
|
||||||
if let Err(e) = self.player.play_song_now(song, None) {
|
format!("Couldn't play song #{id}!"),
|
||||||
if let Some(s) = &self.command_sender {
|
format!("Error: {e}"),
|
||||||
s.send(Command::ErrorInfo(
|
))
|
||||||
format!("Couldn't play song #{id}!"),
|
.unwrap();
|
||||||
format!("Error: {e}"),
|
s.send(Command::NextSong).unwrap();
|
||||||
))
|
|
||||||
.unwrap();
|
|
||||||
s.send(Command::NextSong).unwrap();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
self.player.set_playing(play);
|
|
||||||
}
|
}
|
||||||
} else if let Some(s) = &self.command_sender {
|
} else {
|
||||||
s.send(Command::NextSong).unwrap();
|
self.player.set_playing(play);
|
||||||
}
|
}
|
||||||
|
} else if let Some(s) = &self.command_sender {
|
||||||
|
s.send(Command::NextSong).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user