using .n when rpl is disabled will stop the queue
This commit is contained in:
parent
0e4728d9c9
commit
5e230fad22
@ -252,8 +252,12 @@ namespace NadekoBot.Services.Music
|
||||
// ignore rcs if song is manually skipped
|
||||
|
||||
int queueCount;
|
||||
bool stopped;
|
||||
lock (locker)
|
||||
{
|
||||
queueCount = Queue.Count;
|
||||
stopped = Stopped;
|
||||
}
|
||||
|
||||
if (!manualIndex && (!RepeatCurrentSong || manualSkip))
|
||||
{
|
||||
@ -320,6 +324,7 @@ namespace NadekoBot.Services.Music
|
||||
_log.Info("Next song");
|
||||
lock (locker)
|
||||
{
|
||||
if(!Stopped)
|
||||
Queue.Next();
|
||||
}
|
||||
}
|
||||
@ -422,6 +427,12 @@ namespace NadekoBot.Services.Music
|
||||
// if player is stopped, and user uses .n, it should play current song.
|
||||
// It's a bit weird, but that's the least annoying solution
|
||||
if (!Stopped)
|
||||
if (!RepeatPlaylist && Queue.IsLast()) // if it's the last song in the queue, and repeat playlist is disabled
|
||||
{ //stop the queue
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
else
|
||||
Queue.Next(skipCount - 1);
|
||||
else
|
||||
Queue.CurrentIndex = 0;
|
||||
|
@ -172,5 +172,11 @@ namespace NadekoBot.Services.Music
|
||||
Songs.Remove(song);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsLast()
|
||||
{
|
||||
lock (locker)
|
||||
return CurrentIndex == Songs.Count - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user