Intelligently split link lists to allow URLs with commas

This commit is contained in:
calzoneman 2015-08-19 23:27:05 -07:00
parent 26eb3502be
commit de02cdbeff

View file

@ -344,7 +344,15 @@ function queue(pos, src) {
temp: $(".add-temp").prop("checked") temp: $(".add-temp").prop("checked")
}); });
} else { } else {
var links = $("#mediaurl").val().split(","); var linkList = $("#mediaurl").val();
var links = linkList.split(",http").map(function (link, i) {
if (i > 0) {
return "http" + link;
} else {
return link;
}
});
if (pos === "next") links = links.reverse(); if (pos === "next") links = links.reverse();
if (pos === "next" && $("#queue li").length === 0) links.unshift(links.pop()); if (pos === "next" && $("#queue li").length === 0) links.unshift(links.pop());
var emitQueue = []; var emitQueue = [];