diff --git a/lib/channel/playlist.js b/lib/channel/playlist.js index 97fa5e22..1c952963 100644 --- a/lib/channel/playlist.js +++ b/lib/channel/playlist.js @@ -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");