Skip to content

Commit

Permalink
Merge pull request #160 from Ragzouken/queue-clear
Browse files Browse the repository at this point in the history
queue clear command
  • Loading branch information
Ragzouken authored Nov 13, 2023
2 parents 1ccd873 + a2281aa commit 620a693
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/server/playback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ export class Playback extends EventEmitter {
}
}

clear() {
while (this.queue.length > 0) {
this.unqueue(this.queue[0]);
}
this.clearMedia();
}

get playing() {
return this.remainingTime > 0;
}
Expand Down
3 changes: 3 additions & 0 deletions src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,9 @@ export function host(
}
})
);
authCommands.set('queue-clear', (admin) => {
playback.clear();
});

return { save, sendAll, zone, playback };
}

0 comments on commit 620a693

Please sign in to comment.