Fix Queue.removeCurrent()

This commit is contained in:
Max Isom 2020-03-19 17:22:22 -05:00
parent 7f39642c49
commit 3de34e5e4a
2 changed files with 2 additions and 5 deletions

View file

@ -57,6 +57,7 @@ export default class {
queue.removeCurrent();
if (isPlaying) {
queue.back();
await player.seek(oldPosition);
} else {
player.disconnect();

View file

@ -19,7 +19,7 @@ export default class {
private position = 0;
forward(): void {
if (this.position <= this.size() + 1) {
if (this.position < this.size() + 1) {
this.position++;
} else {
throw new Error('No songs in queue to forward to.');
@ -85,10 +85,6 @@ export default class {
removeCurrent(): void {
this.queue = [...this.queue.slice(0, this.position), ...this.queue.slice(this.position + 1)];
if (this.position !== 0) {
this.position--;
}
}
size(): number {