Fix typo & memory leak in Streamer class

This commit is contained in:
Christer Warén 2021-09-18 15:02:13 +03:00
parent 51a038096a
commit 12db2c5fcc

View File

@ -40,7 +40,7 @@ module.exports = class {
let streamers = this.map.keys();
streamers.forEach(streamer => {
if(client.stations.findIndex(station => station.name == streamer)) return;
if(client.stations.findIndex(station => station.name == streamer) == -1) return;
this.stop(streamer);
});
}
@ -73,15 +73,12 @@ module.exports = class {
this.play(station);
});
audioPlayer
.on('playing', () => {
this.logger('Streamer', station.name + " / " + "Playing");
})
.on('idle', () => {
this.logger('Streamer', station.name + " / " + "Idle");
this.play(station);
})
.on('paused', () => {
this.logger('Streamer', station.name + " / " + "Paused");