mirror of https://github.com/calzoneman/sync.git
Remove debug message; stack queueFail messages clientside
This commit is contained in:
parent
0c52c3f17d
commit
54016f6f48
|
@ -1405,7 +1405,6 @@ Channel.prototype.addMedia = function(data, user) {
|
|||
m.temp = data.temp;
|
||||
var res = self.playlist.addMedia(m);
|
||||
if (res.error) {
|
||||
console.log(res);
|
||||
user.socket.emit("queueFail", res.error);
|
||||
q.release();
|
||||
return;
|
||||
|
|
|
@ -799,8 +799,27 @@ Callbacks = {
|
|||
if (!data) {
|
||||
data = "Queue failed. Check your link to make sure it is valid.";
|
||||
}
|
||||
var alerts = $(".qfalert");
|
||||
for (var i = 0; i < alerts.length; i++) {
|
||||
var al = $(alerts[i]);
|
||||
var cl = al.clone();
|
||||
cl.children().remove();
|
||||
if (cl.text() === data) {
|
||||
var tag = al.find(".label-important");
|
||||
if (tag.length > 0) {
|
||||
var count = parseInt(tag.text().match(/\d+/)[0]) + 1;
|
||||
tag.text(tag.text().replace(/\d+/, ""+count));
|
||||
} else {
|
||||
$("<span/>")
|
||||
.addClass("label label-important pull-right")
|
||||
.text("+ 1 more")
|
||||
.appendTo(al);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
makeAlert("Error", data, "alert-error")
|
||||
.addClass("span12")
|
||||
.addClass("span12 qfalert")
|
||||
.insertBefore($("#extended_controls"));
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue