Update Streamer class

This commit is contained in:
Christer Warén 2021-11-20 04:35:58 +02:00
parent c1ee0f4bc6
commit 5181a2a419

View File

@ -87,7 +87,6 @@ module.exports = class {
}) })
.on('idle', () => { .on('idle', () => {
this.logger('Streamer', station.name + " / " + "Idle"); this.logger('Streamer', station.name + " / " + "Idle");
this.stop(station);
this.play(station); this.play(station);
}) })
.on('paused', () => { .on('paused', () => {
@ -109,6 +108,7 @@ module.exports = class {
let audioPlayer = this.map.get(station.name); let audioPlayer = this.map.get(station.name);
if(audioPlayer){ if(audioPlayer){
this.logger('Streamer', station.name + " / " + "Stop"); this.logger('Streamer', station.name + " / " + "Stop");
audioPlayer.removeAllListeners();
audioPlayer.stop(); audioPlayer.stop();
} }
this.map.delete(station.name); this.map.delete(station.name);