Update Streamer class

This commit is contained in:
Christer Warén 2021-09-11 18:01:53 +03:00
parent 12f3948e40
commit bfec178de7

View File

@ -38,12 +38,13 @@ module.exports = class {
logger('Streamer', station.name + " / " + "Error"); logger('Streamer', station.name + " / " + "Error");
this.map.delete(station.name); this.map.delete(station.name);
}); });
return audioPlayer;
} }
listen(station) { listen(station) {
let audioPlayer = this.map.get(station.name); let audioPlayer = this.map.get(station.name);
if(!audioPlayer){ if(!audioPlayer){
this.play(station); audioPlayer = this.play(station);
} }
return audioPlayer; return audioPlayer;
} }