Dev #11

Merged
EkiciLP merged 5 commits from dev into master 2022-03-21 21:47:23 +00:00
Showing only changes of commit 90514e8e62 - Show all commits

@ -134,7 +134,6 @@ namespace TomatenMusic.Music
public async Task PlayPlaylistNowAsync(LavalinkPlaylist playlist) public async Task PlayPlaylistNowAsync(LavalinkPlaylist playlist)
{ {
EnsureConnected(); EnsureConnected();
EnsureNotDestroyed(); EnsureNotDestroyed();
if (!PlayerQueue.Queue.Any()) if (!PlayerQueue.Queue.Any())
@ -159,6 +158,14 @@ namespace TomatenMusic.Music
public async Task RewindAsync() public async Task RewindAsync()
{ {
EnsureNotDestroyed();
EnsureConnected();
if (Position.Position.Seconds < 4)
{
await ReplayAsync();
return;
}
MusicActionResponse response = PlayerQueue.Rewind(); MusicActionResponse response = PlayerQueue.Rewind();
_logger.LogInformation($"Rewinded Track {CurrentTrack.Title} for Track {response.Track.Title}"); _logger.LogInformation($"Rewinded Track {CurrentTrack.Title} for Track {response.Track.Title}");
@ -168,6 +175,8 @@ namespace TomatenMusic.Music
public async Task SkipAsync() public async Task SkipAsync()
{ {
EnsureNotDestroyed();
EnsureConnected();
MusicActionResponse response = PlayerQueue.NextTrack(true); MusicActionResponse response = PlayerQueue.NextTrack(true);
_logger.LogInformation($"Skipped Track {CurrentTrack.Title} for Track {response.Track.Title}"); _logger.LogInformation($"Skipped Track {CurrentTrack.Title} for Track {response.Track.Title}");