diff --git a/src/bin/server/audio/symphonia/player/impl_audio_player.rs b/src/bin/server/audio/symphonia/player/impl_audio_player.rs index 54e9d90..e271c74 100644 --- a/src/bin/server/audio/symphonia/player/impl_audio_player.rs +++ b/src/bin/server/audio/symphonia/player/impl_audio_player.rs @@ -91,6 +91,13 @@ impl AudioPlayer for SymphoniaPlayer { } fn play_again(&mut self) -> DiziResult { + let playlist = self.playlist_context.current_playlist_ref(); + + if let Some(entry) = playlist.current_entry() { + if let DiziSongEntry::Loaded(audio_file) = entry.entry { + self.play(&audio_file)?; + } + } Ok(()) } diff --git a/src/bin/server/server_commands/playlist.rs b/src/bin/server/server_commands/playlist.rs index 2854e4b..3d8c3af 100644 --- a/src/bin/server/server_commands/playlist.rs +++ b/src/bin/server/server_commands/playlist.rs @@ -40,11 +40,7 @@ pub fn playlist_load(context: &mut AppContext, cwd: &Path, path: &Path) -> DiziR } pub fn playlist_clear(context: &mut AppContext) -> DiziResult { - context - .player - .playlist_context_mut() - .current_playlist_mut() - .clear(); + context.player.playlist_context_mut().file_playlist.clear(); Ok(()) } @@ -56,7 +52,7 @@ pub fn playlist_append(context: &mut AppContext, path: &Path) -> DiziResult DiziResult DiziResult { if index <= len { context .player - .playlist_context - .current_playlist_mut() + .playlist_context_mut() + .file_playlist .remove(index); } Ok(())