mirror of https://github.com/calzoneman/sync.git
Include video ID in the progress bar to prevent false clears
This commit is contained in:
parent
8ed50d0b08
commit
75245e4d98
|
@ -361,25 +361,29 @@ PlaylistModule.prototype.handleQueue = function (user, data) {
|
||||||
if (data.type === "yp" && !perms.canAddList(user)) {
|
if (data.type === "yp" && !perms.canAddList(user)) {
|
||||||
user.socket.emit("queueFail", {
|
user.socket.emit("queueFail", {
|
||||||
msg: "You don't have permission to add playlists",
|
msg: "You don't have permission to add playlists",
|
||||||
link: link
|
link: link,
|
||||||
|
id: id
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else if (util.isLive(type) && !perms.canAddLive(user)) {
|
} else if (util.isLive(type) && !perms.canAddLive(user)) {
|
||||||
user.socket.emit("queueFail", {
|
user.socket.emit("queueFail", {
|
||||||
msg: "You don't have permission to add live media",
|
msg: "You don't have permission to add live media",
|
||||||
link: link
|
link: link,
|
||||||
|
id: id
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else if (type === "cu" && !perms.canAddCustom(user)) {
|
} else if (type === "cu" && !perms.canAddCustom(user)) {
|
||||||
user.socket.emit("queueFail", {
|
user.socket.emit("queueFail", {
|
||||||
msg: "You don't have permission to add custom embeds",
|
msg: "You don't have permission to add custom embeds",
|
||||||
link: link
|
link: link,
|
||||||
|
id: id
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else if (type === "fi" && !perms.canAddRawFile(user)) {
|
} else if (type === "fi" && !perms.canAddRawFile(user)) {
|
||||||
user.socket.emit("queueFail", {
|
user.socket.emit("queueFail", {
|
||||||
msg: "You don't have permission to add raw video files",
|
msg: "You don't have permission to add raw video files",
|
||||||
link: link
|
link: link,
|
||||||
|
id: id
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -412,7 +416,8 @@ PlaylistModule.prototype.handleQueue = function (user, data) {
|
||||||
if (user.queueLimiter.throttle(limit)) {
|
if (user.queueLimiter.throttle(limit)) {
|
||||||
user.socket.emit("queueFail", {
|
user.socket.emit("queueFail", {
|
||||||
msg: "You are adding videos too quickly",
|
msg: "You are adding videos too quickly",
|
||||||
link: link
|
link: link,
|
||||||
|
id: id
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -448,7 +453,8 @@ PlaylistModule.prototype.queueStandard = function (user, data) {
|
||||||
var error = function (what) {
|
var error = function (what) {
|
||||||
user.socket.emit("queueFail", {
|
user.socket.emit("queueFail", {
|
||||||
msg: what,
|
msg: what,
|
||||||
link: data.link
|
link: data.link,
|
||||||
|
id: data.id
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -501,7 +507,8 @@ PlaylistModule.prototype.queueYouTubePlaylist = function (user, data) {
|
||||||
var error = function (what) {
|
var error = function (what) {
|
||||||
user.socket.emit("queueFail", {
|
user.socket.emit("queueFail", {
|
||||||
msg: what,
|
msg: what,
|
||||||
link: data.link
|
link: data.link,
|
||||||
|
id: data.id
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -865,7 +872,8 @@ PlaylistModule.prototype._addItem = function (media, data, user, cb) {
|
||||||
var qfail = function (msg) {
|
var qfail = function (msg) {
|
||||||
user.socket.emit("queueFail", {
|
user.socket.emit("queueFail", {
|
||||||
msg: msg,
|
msg: msg,
|
||||||
link: data.link
|
link: data.link,
|
||||||
|
id: data.id
|
||||||
});
|
});
|
||||||
if (cb) {
|
if (cb) {
|
||||||
cb();
|
cb();
|
||||||
|
|
|
@ -25,7 +25,7 @@ Callbacks = {
|
||||||
.text("Connected")
|
.text("Connected")
|
||||||
.appendTo($("#messagebuffer"));
|
.appendTo($("#messagebuffer"));
|
||||||
scrollChat();
|
scrollChat();
|
||||||
stopQueueSpinner();
|
stopQueueSpinner(null);
|
||||||
},
|
},
|
||||||
|
|
||||||
disconnect: function() {
|
disconnect: function() {
|
||||||
|
@ -724,7 +724,7 @@ Callbacks = {
|
||||||
|
|
||||||
queue: function(data) {
|
queue: function(data) {
|
||||||
PL_ACTION_QUEUE.queue(function (plq) {
|
PL_ACTION_QUEUE.queue(function (plq) {
|
||||||
stopQueueSpinner();
|
stopQueueSpinner(data.item.media.id);
|
||||||
var li = makeQueueEntry(data.item, true);
|
var li = makeQueueEntry(data.item, true);
|
||||||
if (data.item.uid === PL_CURRENT)
|
if (data.item.uid === PL_CURRENT)
|
||||||
li.addClass("queue_active");
|
li.addClass("queue_active");
|
||||||
|
@ -762,7 +762,9 @@ Callbacks = {
|
||||||
},
|
},
|
||||||
|
|
||||||
queueFail: function (data) {
|
queueFail: function (data) {
|
||||||
stopQueueSpinner();
|
if (data.id) {
|
||||||
|
stopQueueSpinner(id);
|
||||||
|
}
|
||||||
queueMessage(data, "alert-danger");
|
queueMessage(data, "alert-danger");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -420,7 +420,7 @@ function queue(pos, src) {
|
||||||
delete data.link;
|
delete data.link;
|
||||||
|
|
||||||
socket.emit("queue", data);
|
socket.emit("queue", data);
|
||||||
startQueueSpinner();
|
startQueueSpinner(data.id);
|
||||||
if (emitQueue.length > 0) {
|
if (emitQueue.length > 0) {
|
||||||
notification.textContent = "Waiting to queue " + emitQueue[0].link;
|
notification.textContent = "Waiting to queue " + emitQueue[0].link;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -3041,12 +3041,13 @@ function showChannelSettings() {
|
||||||
// There is a point where this file needed to stop and we have clearly passed
|
// There is a point where this file needed to stop and we have clearly passed
|
||||||
// it but let's keep going and see what happens
|
// it but let's keep going and see what happens
|
||||||
|
|
||||||
function startQueueSpinner() {
|
function startQueueSpinner(id) {
|
||||||
if ($("#queueprogress").length > 0) {
|
if ($("#queueprogress").length > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var progress = $("<div/>").addClass("progress").attr("id", "queueprogress");
|
var progress = $("<div/>").addClass("progress").attr("id", "queueprogress")
|
||||||
|
.data("queue-id", id);
|
||||||
var progressBar = $("<div/>").addClass("progress-bar progress-bar-striped active")
|
var progressBar = $("<div/>").addClass("progress-bar progress-bar-striped active")
|
||||||
.attr({
|
.attr({
|
||||||
role: "progressbar",
|
role: "progressbar",
|
||||||
|
@ -3059,6 +3060,10 @@ function startQueueSpinner() {
|
||||||
progress.appendTo($("#addfromurl"));
|
progress.appendTo($("#addfromurl"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopQueueSpinner() {
|
function stopQueueSpinner(id) {
|
||||||
|
if (id && $("#queueprogress").data("queue-id") === id) {
|
||||||
$("#queueprogress").remove();
|
$("#queueprogress").remove();
|
||||||
|
} else if (id === null) {
|
||||||
|
$("#queueprogress").remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue