- fixed PlayNow issue

This commit is contained in:
Tim Müller 2022-10-09 16:59:48 +02:00
parent 5a9d978b5e
commit 0024325f4f
3 changed files with 7 additions and 3 deletions

@ -44,7 +44,9 @@ namespace TomatenMusic.Music.Entitites
if (!player.PlayerQueue.Queue.Any())
player.PlayerQueue.CurrentPlaylist = this;
player.PlayerQueue.Queue = new Queue<TomatenMusicTrack>(player.PlayerQueue.Queue.Prepend(new TomatenMusicTrack(player.PlayerQueue.LastTrack.WithPosition(player.TrackPosition))));
if (!withoutQueuePrepend && player.State == PlayerState.Playing)
player.PlayerQueue.Queue = new Queue<TomatenMusicTrack>(player.PlayerQueue.Queue.Prepend(new TomatenMusicTrack(player.PlayerQueue.LastTrack.WithPosition(player.TrackPosition))));
Queue<TomatenMusicTrack> reversedTracks = new Queue<TomatenMusicTrack>(Tracks);

@ -38,7 +38,7 @@ namespace TomatenMusicCore.Music.Entities
public async Task PlayNow(GuildPlayer player, TimeSpan? startTime = null, TimeSpan? endTime = null, bool withoutQueuePrepend = false)
{
if (!withoutQueuePrepend)
if (!withoutQueuePrepend && player.State == PlayerState.Playing)
player.PlayerQueue.Queue = new Queue<TomatenMusicTrack>(player.PlayerQueue.Queue.Prepend(new TomatenMusicTrack(player.PlayerQueue.LastTrack.WithPosition(player.TrackPosition))));

@ -57,7 +57,9 @@ namespace TomatenMusic.Music.Entitites
if (!player.PlayerQueue.Queue.Any())
player.PlayerQueue.CurrentPlaylist = this;
player.PlayerQueue.Queue = new Queue<TomatenMusicTrack>(player.PlayerQueue.Queue.Prepend(new TomatenMusicTrack(player.PlayerQueue.LastTrack.WithPosition(player.TrackPosition))));
if (!withoutQueuePrepend && player.State == PlayerState.Playing)
player.PlayerQueue.Queue = new Queue<TomatenMusicTrack>(player.PlayerQueue.Queue.Prepend(new TomatenMusicTrack(player.PlayerQueue.LastTrack.WithPosition(player.TrackPosition))));
Queue<TomatenMusicTrack> reversedTracks = new Queue<TomatenMusicTrack>(Tracks);