diff --git a/channel.js b/channel.js index 3d85a15a..97444d5a 100644 --- a/channel.js +++ b/channel.js @@ -332,17 +332,22 @@ Channel.prototype.enqueue = function(data) { return; } - // Whoever decided on this variable name should be fired - var seconds = data.entry.media$group.yt$duration.seconds; - // This one's slightly better - var title = data.entry.title.$t; - var vid = new Media(id, title, seconds, "yt"); - chan.queue.splice(idx, 0, vid); - chan.sendAll('queue', { - media: vid.pack(), - pos: idx - }); - chan.addToLibrary(vid); + try { + // Whoever decided on this variable name should be fired + var seconds = data.entry.media$group.yt$duration.seconds; + // This one's slightly better + var title = data.entry.title.$t; + var vid = new Media(id, title, seconds, "yt"); + chan.queue.splice(idx, 0, vid); + chan.sendAll('queue', { + media: vid.pack(), + pos: idx + }); + chan.addToLibrary(vid); + } + catch(e) { + console.log("YTQueue Fail: id=" + id); + } }})(this, data.id); InfoGetter.getYTInfo(data.id, callback); }