magmastream 2.9.0-dev.21 → 2.9.0-dev.23

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.
@@ -546,6 +546,7 @@ class Node {
546
546
  await player.queue.setPrevious(trimmed);
547
547
  }
548
548
  }
549
+ player.set("skipFlag", false);
549
550
  const oldPlayer = player;
550
551
  // Handle track end events
551
552
  switch (reason) {
@@ -681,7 +681,6 @@ class Player {
681
681
  track: lastTrack,
682
682
  },
683
683
  });
684
- this.set("skipFlag", false);
685
684
  return this;
686
685
  }
687
686
  /**
@@ -37,10 +37,14 @@ class Queue extends Array {
37
37
  }
38
38
  async addPrevious(track) {
39
39
  if (Array.isArray(track)) {
40
- this.previous.unshift(...track);
40
+ const newTracks = track.filter((t) => !this.previous.some((p) => p.identifier === t.identifier));
41
+ this.previous.unshift(...newTracks);
41
42
  }
42
43
  else {
43
- this.previous.unshift(track);
44
+ const exists = this.previous.some((p) => p.identifier === track.identifier);
45
+ if (!exists) {
46
+ this.previous.unshift(track);
47
+ }
44
48
  }
45
49
  }
46
50
  async setPrevious(tracks) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magmastream",
3
- "version": "2.9.0-dev.21",
3
+ "version": "2.9.0-dev.23",
4
4
  "description": "A user-friendly Lavalink client designed for NodeJS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",