|
@@ -71,12 +71,12 @@ impl AudioState {
|
|
|
|
|
|
async fn play_audio(audio_state: Arc<AudioState>) {
|
|
|
let is_looping = audio_state.is_looping.lock().await;
|
|
|
- let mut queue = audio_state.queue.lock().await;
|
|
|
+ let queue = audio_state.queue.lock().await;
|
|
|
let song = if *is_looping {
|
|
|
let mut current_song = audio_state.current_song.lock().await;
|
|
|
current_song.take()
|
|
|
} else {
|
|
|
- queue.pop()
|
|
|
+ queue.peek()
|
|
|
};
|
|
|
drop(is_looping);
|
|
|
|
|
@@ -217,6 +217,10 @@ struct SongEndNotifier {
|
|
|
#[async_trait]
|
|
|
impl VoiceEventHandler for SongEndNotifier {
|
|
|
async fn act(&self, _ctx: &EventContext<'_>) -> Option<Event> {
|
|
|
+ {
|
|
|
+ let mut queue = self.audio_state.queue.lock().await;
|
|
|
+ queue.pop();
|
|
|
+ }
|
|
|
AudioState::play_audio(self.audio_state.clone()).await;
|
|
|
|
|
|
None
|