Bugfix youtube search
This commit is contained in:
parent
66dde5f337
commit
fc1c5d4896
3 changed files with 33 additions and 12 deletions
|
|
@ -302,8 +302,12 @@ function initCallbacks() {
|
|||
var ul = $("#library")[0];
|
||||
for(var i = 0; i < data.results.length; i++) {
|
||||
var li = makeQueueEntry(data.results[i]);
|
||||
if(RANK >= Rank.Moderator || OPENQUEUE || LEADER)
|
||||
addLibraryButtons(li, data.results[i].id);
|
||||
if(RANK >= Rank.Moderator || OPENQUEUE || LEADER) {
|
||||
if(data.results[i].thumb)
|
||||
addLibraryButtons(li, data.results[i].id, true);
|
||||
else
|
||||
addLibraryButtons(li, data.results[i].id);
|
||||
}
|
||||
$(li).appendTo(ul);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ function rebuildPlaylist() {
|
|||
}
|
||||
|
||||
// Add buttons to a list entry for the library search results
|
||||
function addLibraryButtons(li, id) {
|
||||
function addLibraryButtons(li, id, yt) {
|
||||
var btnstrip = $("<div />").attr("class", "btn-group qe_buttons").prependTo(li);
|
||||
|
||||
|
||||
|
|
@ -281,17 +281,35 @@ function addLibraryButtons(li, id) {
|
|||
|
||||
// Callback time
|
||||
$(btnNext).click(function() {
|
||||
socket.emit("queue", {
|
||||
id: id,
|
||||
pos: "next"
|
||||
});
|
||||
if(yt) {
|
||||
socket.emit("queue", {
|
||||
id: id,
|
||||
pos: "next",
|
||||
type: "yt"
|
||||
});
|
||||
}
|
||||
else {
|
||||
socket.emit("queue", {
|
||||
id: id,
|
||||
pos: "next"
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(btnEnd).click(function() {
|
||||
socket.emit("queue", {
|
||||
id: id,
|
||||
pos: "end"
|
||||
});
|
||||
if(yt) {
|
||||
socket.emit("queue", {
|
||||
id: id,
|
||||
pos: "end",
|
||||
type: "yt"
|
||||
});
|
||||
}
|
||||
else {
|
||||
socket.emit("queue", {
|
||||
id: id,
|
||||
pos: "end"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue