magmastream 2.5.3 → 2.5.5
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/dist/structures/Manager.js +6 -2
- package/dist/structures/Node.js +13 -11
- package/package.json +1 -1
|
@@ -189,10 +189,14 @@ class Manager extends events_1.EventEmitter {
|
|
|
189
189
|
tracksToReplace = result.tracks;
|
|
190
190
|
}
|
|
191
191
|
for (const track of tracksToReplace) {
|
|
192
|
-
if (isYouTubeURL(track.uri)
|
|
192
|
+
if (isYouTubeURL(track.uri)) {
|
|
193
|
+
track.author = track.author.replace("- Topic", "");
|
|
194
|
+
track.title = track.title.replace("Topic -", "");
|
|
195
|
+
}
|
|
196
|
+
if (track.title.includes("-")) {
|
|
193
197
|
const [author, title] = track.title.split("-").map((str) => str.trim());
|
|
194
198
|
track.author = author;
|
|
195
|
-
track.title = title
|
|
199
|
+
track.title = title;
|
|
196
200
|
}
|
|
197
201
|
}
|
|
198
202
|
}
|
package/dist/structures/Node.js
CHANGED
|
@@ -291,20 +291,22 @@ class Node {
|
|
|
291
291
|
}
|
|
292
292
|
// Handle the case when a track ended and it's set to repeat (track or queue)
|
|
293
293
|
handleRepeatedTrack(player, track, payload) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
this.queueEnd(player, track, payload);
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
294
|
+
const { queue, trackRepeat, queueRepeat } = player;
|
|
295
|
+
const { autoPlay } = this.manager.options;
|
|
296
|
+
if (trackRepeat) {
|
|
297
|
+
queue.unshift(queue.current);
|
|
301
298
|
}
|
|
302
|
-
else {
|
|
303
|
-
|
|
304
|
-
player.queue.current = player.queue.shift();
|
|
299
|
+
else if (queueRepeat) {
|
|
300
|
+
queue.add(queue.current);
|
|
305
301
|
}
|
|
302
|
+
queue.previous = queue.current;
|
|
303
|
+
queue.current = queue.shift();
|
|
306
304
|
this.manager.emit("trackEnd", player, track, payload);
|
|
307
|
-
if (
|
|
305
|
+
if (payload.reason === "stopped" && !(queue.current = queue.shift())) {
|
|
306
|
+
this.queueEnd(player, track, payload);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (autoPlay)
|
|
308
310
|
player.play();
|
|
309
311
|
}
|
|
310
312
|
// Handle the case when there's another track in the queue
|