mirror of
https://github.com/reality/dbot.git
synced 2024-12-26 04:32:37 +01:00
fuck timers
This commit is contained in:
parent
0913f382d7
commit
e4997cd915
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user