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

fix for nowplaying

This commit is contained in:
reality 2015-05-06 18:17:06 +00:00
parent b440a232fc
commit b28a5f6655
2 changed files with 4 additions and 4 deletions

View File

@ -33,12 +33,12 @@ var radio = function(dbot) {
}.bind(this)); }.bind(this));
stream.on('metadata', function(metadata) { 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 if(!_.isUndefined(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'],
'song': title, 'song': this.title,
'url': this.data['icy-url'] 'url': this.data['icy-url']
})); }));
}, this); }, this);
@ -73,7 +73,7 @@ var radio = function(dbot) {
if(this.listening) { if(this.listening) {
event.reply(dbot.say(a.server, a.name, dbot.t('now_playing', { event.reply(dbot.say(a.server, a.name, dbot.t('now_playing', {
'name': this.data['icy-name'], 'name': this.data['icy-name'],
'song': title, 'song': this.title,
'url': this.data['icy-url'] 'url': this.data['icy-url']
}))); })));
} else { } else {

2
run.js
View File

@ -3,7 +3,7 @@ var fs = require('fs'),
jsbot = require('./jsbot/jsbot'), jsbot = require('./jsbot/jsbot'),
DatabaseDriver = require('./database').DatabaseDriver, DatabaseDriver = require('./database').DatabaseDriver,
async = require('async'); async = require('async');
require('./snippets'); require('./snippets');
var DBot = function() { var DBot = function() {