Fix unregistered channels and jwplayer custom timing

This commit is contained in:
Calvin Montgomery 2014-05-26 13:02:03 -07:00
parent 3cae0b0e57
commit 1917baa4c3
1 changed files with 8 additions and 5 deletions

View File

@ -434,9 +434,11 @@ PlaylistModule.prototype.queueStandard = function (user, data) {
handleLookup();
}
});
} else {
handleLookup();
}
var handleLookup = function () {
function handleLookup() {
InfoGetter.getMedia(data.id, data.type, function (err, media) {
if (err) {
error(err+"");
@ -449,10 +451,6 @@ PlaylistModule.prototype.queueStandard = function (user, data) {
self.channel.activeLock.release();
});
});
};
if (!lib || util.isLive(data.type)) {
handleLookup();
}
});
};
@ -835,6 +833,11 @@ PlaylistModule.prototype._addItem = function (media, data, user, cb) {
}
};
if (data.duration) {
media.seconds = data.duration;
media.duration = util.formatTime(media.seconds);
}
if (data.maxlength > 0 && media.seconds > data.maxlength) {
return qfail("Video exceeds the maximum length set by the channel admin: " +
data.maxlength + " seconds");