DSharpPlus icon indicating copy to clipboard operation
DSharpPlus copied to clipboard

CurrentTrack is not null after stopAsync

Open Koin101 opened this issue 1 year ago • 2 comments

Make sure you familiarize yourself with our contributing guidelines.

Summary

When I call the stopAsync function to stop the currentrack such that I can play a new track aka skip. The currenTrack state does not get updated and thus when the new song is playing and I want to add a song to my queue it thinks that there is no song playing and it overwrites the currently playing song. Since I check whether currentTrack == null.

Details

OS: Windows 10/11 and raspberry OS framework: .net 7.0

Steps to reproduce

  1. Play any song
  2. Use StopAsync() and immediately play a new song or in my case next song in queue
  3. While song is playing, play a new one but check if song is playing using currenttrack.
  4. notice that playing song is overwritten by the new song

Notes

I think adding the line CurrentState.CurrentTrack = null; to StopAsync() will solve the problem.

But I am fairly new to this so maybe this is intended. In that case how do I check wether a song is playing after using StopAsync()?

Koin101 avatar Aug 08 '23 15:08 Koin101

Please specify what version of DSharpPlus and what extension you are using.

akiraveliara avatar Oct 05 '23 19:10 akiraveliara

I am using version 4.3.0 and lavalink version 3.7.8

Koin101 avatar Oct 09 '23 09:10 Koin101