update queue
This commit is contained in:
parent
e50066ee0d
commit
8902d06057
1 changed files with 2 additions and 3 deletions
|
@ -150,7 +150,7 @@ class Queue<T = unknown> {
|
||||||
*/
|
*/
|
||||||
setPaused(paused?: boolean) {
|
setPaused(paused?: boolean) {
|
||||||
if (!this.connection) return false;
|
if (!this.connection) return false;
|
||||||
return paused ? this.connection.pause() : this.connection.resume();
|
return paused ? this.connection.pause(true) : this.connection.resume();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -180,8 +180,7 @@ class Queue<T = unknown> {
|
||||||
*/
|
*/
|
||||||
setRepeatMode(mode: QueueRepeatMode) {
|
setRepeatMode(mode: QueueRepeatMode) {
|
||||||
if (![QueueRepeatMode.OFF, QueueRepeatMode.QUEUE, QueueRepeatMode.TRACK].includes(mode)) throw new Error(`Unknown repeat mode "${mode}"!`);
|
if (![QueueRepeatMode.OFF, QueueRepeatMode.QUEUE, QueueRepeatMode.TRACK].includes(mode)) throw new Error(`Unknown repeat mode "${mode}"!`);
|
||||||
const prev = this.repeatMode;
|
if (mode === this.repeatMode) return false;
|
||||||
if (mode === prev) return false;
|
|
||||||
this.repeatMode = mode;
|
this.repeatMode = mode;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue