From 1917baa4c30dc72028e72b6d4b0e7487c0dd76bf Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Mon, 26 May 2014 13:02:03 -0700 Subject: [PATCH] Fix unregistered channels and jwplayer custom timing --- lib/channel/playlist.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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");