ready4testing

This commit is contained in:
Gerrit Linnemann 2015-11-02 16:48:22 +01:00
parent 101315a1b5
commit a81efff715

View File

@ -56,18 +56,17 @@ exports.play = function(idx) {
var channel = Conf.channels[idx]; var channel = Conf.channels[idx];
if(channel !== undefined) { if(channel !== undefined) {
var stream2play = channel.stream; var stream2play = channel.stream;
var m3u = '/tmp/kitchenradio.m3u'; var m3u = '/tmp/kitchenradio.m3u';
try { try {
fs.unlinkSync(m3u); fs.unlinkSync(m3u);
} catch(e) { } catch(e) {
Log.error('Radio: Error deleting "' + m3u + '".' + e); Log.error('Radio: Error deleting "' + m3u + '".' + e);
} }
try {
wget.download(channel.stream, m3u); var download = wget.download(channel.stream, m3u);
} catch(e) { download.on('end', function(output) {
Log.error('Radio: Error downloading "' + channel.stream + '".' + e); Log.inspect('Radio: Download completed', output);
}
if(Helper.isDefinedAndNotNull(Child)) { if(Helper.isDefinedAndNotNull(Child)) {
try { try {
@ -113,6 +112,8 @@ exports.play = function(idx) {
/*Child.on('exit', function (code){ /*Child.on('exit', function (code){
Log.log('Radio: Child process exited with exit code ' + code); Log.log('Radio: Child process exited with exit code ' + code);
});*/ });*/
});
} else { } else {
Log.error('Radio: No channel defined!'); Log.error('Radio: No channel defined!');
} }