3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00

fix for nowplaying

This commit is contained in:
reality 2015-05-06 18:18:27 +00:00
parent b28a5f6655
commit 4895c12b6d

View File

@ -9,6 +9,7 @@ var _ = require('underscore')._,
var radio = function(dbot) { var radio = function(dbot) {
this.listening = false; this.listening = false;
this.data = false; this.data = false;
this.title = false;
this.stream = false; this.stream = false;
this.internalAPI = { this.internalAPI = {
'startRadio': function() { 'startRadio': function() {
@ -34,7 +35,7 @@ var radio = function(dbot) {
stream.on('metadata', function(metadata) { stream.on('metadata', function(metadata) {
this.title = icecast.parseMetadata(metadata).StreamTitle; this.title = icecast.parseMetadata(metadata).StreamTitle;
if(!_.isUndefined(title) && this.data['icy-name']) { // sowwy jesus if(!_.isUndefined(this.title) && this.data['icy-name']) { // sowwy jesus
_.each(this.config.announce, function(a) { _.each(this.config.announce, function(a) {
dbot.say(a.server, a.name, dbot.t('now_playing', { dbot.say(a.server, a.name, dbot.t('now_playing', {
'name': this.data['icy-name'], 'name': this.data['icy-name'],