fuck timers

This commit is contained in:
reality 2014-02-17 20:31:20 +00:00
parent 0913f382d7
commit e4997cd915

View File

@ -9,9 +9,11 @@ var _ = require('underscore')._,
var radio = function(dbot) {
this.listening = false;
this.data = false;
this.stream = false;
this.internalAPI = {
'startRadio': function() {
var stream = icecast.createReadStream(this.config.stream);
this.stream = stream;
stream.on('connect', function() {
this.listening = true;
@ -40,6 +42,7 @@ var radio = function(dbot) {
}.bind(this));
stream.on('end', function() {
this.stream.close();
this.listening = false;
}.bind(this));
}.bind(this),
@ -55,6 +58,9 @@ var radio = function(dbot) {
this.onLoad = function() {
this.internalAPI.getRadio();
}.bind(this);
this.onDestroy = function() {
this.stream.close();
}.bind(this);
};
exports.fetch = function(dbot) {