diff --git a/TomatenMusicCore/Music/GuildPlayer.cs b/TomatenMusicCore/Music/GuildPlayer.cs index f0510ea..d90147e 100644 --- a/TomatenMusicCore/Music/GuildPlayer.cs +++ b/TomatenMusicCore/Music/GuildPlayer.cs @@ -109,7 +109,7 @@ namespace TomatenMusic.Music MusicActionResponse response; try { - response = PlayerQueue.NextTrack(true); + response = PlayerQueue.(true); }catch (Exception ex) { if (Autoplay) @@ -249,6 +249,7 @@ namespace TomatenMusic.Music TomatenMusicTrack newTrack = await youtube.GetRelatedTrackAsync(oldTrack.TrackIdentifier, PlayerQueue.PlayedTracks.Take(5).ToList().ConvertAll(x => x.TrackIdentifier)); _logger.LogInformation($"Autoplaying for track {oldTrack.TrackIdentifier} with Track {newTrack.TrackIdentifier}"); await base.OnTrackEndAsync(eventArgs); + PlayerQueue.LastTrack = newTrack; await newTrack.Play(this); QueuePrompt.UpdateFor(GuildId); diff --git a/TomatenMusicCore/Music/PlayerQueue.cs b/TomatenMusicCore/Music/PlayerQueue.cs index b705f8a..b8ca3cf 100644 --- a/TomatenMusicCore/Music/PlayerQueue.cs +++ b/TomatenMusicCore/Music/PlayerQueue.cs @@ -95,7 +95,7 @@ namespace TomatenMusic.Music public MusicActionResponse NextTrack(bool ignoreLoop = false) { if (LastTrack != null) - PlayedTracks = new Queue(PlayedTracks.Prepend(LastTrack)); + PlayedTracks = new Queue(PlayedTracks.Prepend(new TomatenMusicTrack(LastTrack.WithPosition(TimeSpan.Zero)))); switch (LoopType) {