mirror of https://github.com/calzoneman/sync.git
Fix bad youtube callback crashing server
This commit is contained in:
parent
090eaa37c2
commit
d68d0277bb
27
channel.js
27
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue