muthera 1.0.8 → 1.0.9
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.
- package/package.json +1 -1
- package/src/structures/mutheraPlayer.js +16 -10
package/package.json
CHANGED
|
@@ -117,13 +117,16 @@ class Player extends EventEmitter {
|
|
|
117
117
|
)
|
|
118
118
|
return fail();
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
// Filter out the previous track to avoid immediate duplicate
|
|
121
|
+
const tracks = response.tracks.filter(
|
|
122
|
+
(t) => t.info.identifier !== player.previous.info.identifier
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
if (!tracks.length) return fail();
|
|
124
126
|
|
|
125
127
|
if (this.connected) {
|
|
126
|
-
|
|
128
|
+
// Push entire Mix playlist into queue
|
|
129
|
+
for (const t of tracks) this.queue.push(t);
|
|
127
130
|
await this.play();
|
|
128
131
|
} else {
|
|
129
132
|
return fail();
|
|
@@ -148,13 +151,16 @@ class Player extends EventEmitter {
|
|
|
148
151
|
)
|
|
149
152
|
return fail();
|
|
150
153
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
// Filter out the previous track to avoid immediate duplicate
|
|
155
|
+
const tracks = response.tracks.filter(
|
|
156
|
+
(t) => t.info.identifier !== player.previous.info.identifier
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
if (!tracks.length) return fail();
|
|
155
160
|
|
|
156
161
|
if (this.connected) {
|
|
157
|
-
|
|
162
|
+
// Push entire Mix playlist into queue
|
|
163
|
+
for (const t of tracks) this.queue.push(t);
|
|
158
164
|
await this.play();
|
|
159
165
|
} else {
|
|
160
166
|
return fail();
|