better handling of comma-separated queues
This commit is contained in:
parent
4c38276f14
commit
d3079a2b07
2 changed files with 46 additions and 21 deletions
|
|
@ -190,6 +190,7 @@ function queue(pos) {
|
|||
if(pos == "next") {
|
||||
links = links.reverse();
|
||||
}
|
||||
var parsed = [];
|
||||
links.forEach(function(link) {
|
||||
var data = parseMediaLink(link);
|
||||
if(data.id === null || data.type === null) {
|
||||
|
|
@ -200,12 +201,24 @@ function queue(pos) {
|
|||
else {
|
||||
$("#mediaurl").val("");
|
||||
}
|
||||
socket.emit("queue", {
|
||||
parsed.push({
|
||||
id: data.id,
|
||||
type: data.type,
|
||||
pos: "end"
|
||||
type: data.type
|
||||
});
|
||||
});
|
||||
|
||||
if(parsed.length > 1) {
|
||||
socket.emit("queue", {
|
||||
id: false,
|
||||
list: parsed,
|
||||
type: "list",
|
||||
pos: pos
|
||||
});
|
||||
}
|
||||
else {
|
||||
parsed[0].pos = pos;
|
||||
socket.emit("queue", parsed[0]);
|
||||
}
|
||||
}
|
||||
|
||||
$("#queue_next").click(function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue