diff --git a/lib/channel.js b/lib/channel.js index 5ffd78a4..9337c062 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -1814,19 +1814,19 @@ Channel.prototype.handleQueuePlaylist = function (user, data) { } } - for (var i = 0; i < pl.length; i++) { - pl[i].pos = pos; - pl[i].temp = temp; - pl[i].queueby = user.name; - self.addMedia(pl[i], function (err, media) { + pl.forEach(function (pli) { + pli.pos = pos; + pli.temp = temp; + pli.queueby = user.name; + self.addMedia(pli, function (err, media) { if (err) { user.socket.emit("queueFail", { msg: err, - link: util.formatLink(pl[i].id, pl[i].type) + link: util.formatLink(pli.id, pli.type) }); } }); - } + }); } catch (e) { Logger.errlog.log("Loading user playlist failed!"); Logger.errlog.log("PL: " + user.name + "-" + name);