mirror of https://github.com/calzoneman/sync.git
Fix queue progress bar for youtube playlists
This commit is contained in:
parent
75245e4d98
commit
a00820a4c6
|
@ -724,7 +724,7 @@ Callbacks = {
|
|||
|
||||
queue: function(data) {
|
||||
PL_ACTION_QUEUE.queue(function (plq) {
|
||||
stopQueueSpinner(data.item.media.id);
|
||||
stopQueueSpinner(data.item.media);
|
||||
var li = makeQueueEntry(data.item, true);
|
||||
if (data.item.uid === PL_CURRENT)
|
||||
li.addClass("queue_active");
|
||||
|
|
|
@ -420,7 +420,7 @@ function queue(pos, src) {
|
|||
delete data.link;
|
||||
|
||||
socket.emit("queue", data);
|
||||
startQueueSpinner(data.id);
|
||||
startQueueSpinner(data);
|
||||
if (emitQueue.length > 0) {
|
||||
notification.textContent = "Waiting to queue " + emitQueue[0].link;
|
||||
} else {
|
||||
|
|
|
@ -3041,11 +3041,16 @@ function showChannelSettings() {
|
|||
// 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
|
||||
|
||||
function startQueueSpinner(id) {
|
||||
function startQueueSpinner(data) {
|
||||
if ($("#queueprogress").length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var id = data.id;
|
||||
if (data.type === "yp") {
|
||||
id = "$any";
|
||||
}
|
||||
|
||||
var progress = $("<div/>").addClass("progress").attr("id", "queueprogress")
|
||||
.data("queue-id", id);
|
||||
var progressBar = $("<div/>").addClass("progress-bar progress-bar-striped active")
|
||||
|
@ -3060,10 +3065,12 @@ function startQueueSpinner(id) {
|
|||
progress.appendTo($("#addfromurl"));
|
||||
}
|
||||
|
||||
function stopQueueSpinner(id) {
|
||||
if (id && $("#queueprogress").data("queue-id") === id) {
|
||||
$("#queueprogress").remove();
|
||||
} else if (id === null) {
|
||||
function stopQueueSpinner(data) {
|
||||
var shouldRemove = (typeof data === 'object' &&
|
||||
$("#queueprogress").data("queue-id") === data.id);
|
||||
shouldRemove = shouldRemove || data === null;
|
||||
shouldRemove = shouldRemove || $("#queueprogress").data("queue-id") === "$any";
|
||||
if (shouldRemove) {
|
||||
$("#queueprogress").remove();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue