Skip to content

Commit 4dd2932

Browse files
authored
fix : queueEnd event (#124)
2 parents 7637417 + 6434f66 commit 4dd2932

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/entities/Node.ts

+13
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,13 @@ export class Node {
244244
player,
245245
player.current,
246246
)
247+
248+
this.manager.emit(
249+
"queueEnd",
250+
player,
251+
player.current
252+
)
253+
247254
this.manager.emit(
248255
"debug",
249256
"Moonlink.js > Player " +
@@ -255,6 +262,12 @@ export class Node {
255262
if (!player.queue.size) {
256263
player.current = null;
257264
player.queue.clear();
265+
266+
this.manager.emit(
267+
"queueEnd",
268+
player,
269+
player.current
270+
)
258271

259272
this.manager.emit(
260273
"debug",

src/typings/Interfaces.ts

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export interface IEvents {
5959
) => void;
6060
trackStuck: (player: Player, track: Track, threshold: number) => void;
6161
trackException: (player: Player, track: Track, exception: any) => void;
62+
queueEnd: (player: Player, track?: any) => void;
6263
socketClosed: (
6364
player: Player,
6465
code: number,

0 commit comments

Comments
 (0)