From b28a5f665516a5c3b7819de4f2ff9a2148ece07c Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 6 May 2015 18:17:06 +0000 Subject: [PATCH] fix for nowplaying --- modules/radio/radio.js | 6 +++--- run.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/radio/radio.js b/modules/radio/radio.js index 0bd3c37..bf10781 100644 --- a/modules/radio/radio.js +++ b/modules/radio/radio.js @@ -33,12 +33,12 @@ var radio = function(dbot) { }.bind(this)); stream.on('metadata', function(metadata) { - var title = icecast.parseMetadata(metadata).StreamTitle; + this.title = icecast.parseMetadata(metadata).StreamTitle; if(!_.isUndefined(title) && this.data['icy-name']) { // sowwy jesus _.each(this.config.announce, function(a) { dbot.say(a.server, a.name, dbot.t('now_playing', { 'name': this.data['icy-name'], - 'song': title, + 'song': this.title, 'url': this.data['icy-url'] })); }, this); @@ -73,7 +73,7 @@ var radio = function(dbot) { if(this.listening) { event.reply(dbot.say(a.server, a.name, dbot.t('now_playing', { 'name': this.data['icy-name'], - 'song': title, + 'song': this.title, 'url': this.data['icy-url'] }))); } else { diff --git a/run.js b/run.js index 4a7c474..91d36ef 100644 --- a/run.js +++ b/run.js @@ -3,7 +3,7 @@ var fs = require('fs'), jsbot = require('./jsbot/jsbot'), DatabaseDriver = require('./database').DatabaseDriver, async = require('async'); -require('./snippets'); + require('./snippets'); var DBot = function() {