magmastream 2.9.0-dev.19 → 2.9.0-dev.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -540,10 +540,10 @@ class Node {
540
540
  const current = await player.queue.getCurrent();
541
541
  if (!skipFlag && (previous.length === 0 || (previous[0] && previous[0].track !== current?.track))) {
542
542
  await player.queue.addPrevious(current);
543
- let previous = await player.queue.getPrevious();
544
- if (previous.length > this.manager.options.maxPreviousTracks) {
545
- previous = previous.slice(0, this.manager.options.maxPreviousTracks); // drop oldest
546
- await player.queue.setPrevious(previous);
543
+ const updated = await player.queue.getPrevious();
544
+ if (updated.length > this.manager.options.maxPreviousTracks) {
545
+ const trimmed = updated.slice(0, this.manager.options.maxPreviousTracks);
546
+ await player.queue.setPrevious(trimmed);
547
547
  }
548
548
  }
549
549
  const oldPlayer = player;
@@ -33,7 +33,7 @@ class Queue extends Array {
33
33
  this.current = track;
34
34
  }
35
35
  async getPrevious() {
36
- return this.previous;
36
+ return [...this.previous];
37
37
  }
38
38
  async addPrevious(track) {
39
39
  if (Array.isArray(track)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magmastream",
3
- "version": "2.9.0-dev.19",
3
+ "version": "2.9.0-dev.20",
4
4
  "description": "A user-friendly Lavalink client designed for NodeJS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",