diff --git a/database.js b/database.js index b43d8ae2..7ac7df3e 100644 --- a/database.js +++ b/database.js @@ -180,7 +180,6 @@ exports.lookupChannelRank = function(channame, username) { var query = "SELECT * FROM chan_{1}_ranks WHERE name='{2}'" .replace("{1}", channame) .replace("{2}", username); - console.log(query); var results = db.querySync(query); if(!results) { return Rank.Guest; diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js index c005088c..72546a25 100644 --- a/www/assets/js/callbacks.js +++ b/www/assets/js/callbacks.js @@ -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); } }); diff --git a/www/assets/js/functions.js b/www/assets/js/functions.js index 8aff6dfd..3f80c3c5 100644 --- a/www/assets/js/functions.js +++ b/www/assets/js/functions.js @@ -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 = $("
").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" + }); + } }); }