fix playback bug

This commit is contained in:
Mark 2024-10-25 20:31:48 +02:00
parent 14660b6dae
commit c03c35f1c9

View File

@ -88,11 +88,9 @@ 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() {
self.player.set_playing(play);
} else {
if let Some((id, song, _)) = &self.current { if let Some((id, song, _)) = &self.current {
if let Some(song) = song { if let Some(song) = song {
if let Err(e) = self.player.play_song_now(song, None) { if let Err(e) = self.player.play_song_now(song, None) {
@ -112,7 +110,6 @@ impl<T> PlayerBackend<T> for PlayerBackendPlaybackRs<T> {
} }
} }
} }
}
fn clear(&mut self) { fn clear(&mut self) {
// remove next song // remove next song
let _ = self.player.force_remove_next_song(); let _ = self.player.force_remove_next_song();