From 5b793710c3d6ccd3d23155441d1dbe5bd4a50fe6 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Fri, 28 Feb 2014 08:43:04 -0600 Subject: [PATCH] Fixes --- lib/channel.js | 6 ++-- lib/web/webserver.js | 2 +- www/js/callbacks.js | 82 ++++---------------------------------------- www/js/player.js | 6 ++-- www/js/util.js | 6 ++-- 5 files changed, 18 insertions(+), 84 deletions(-) diff --git a/lib/channel.js b/lib/channel.js index 132ce809..9962e33c 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -2048,11 +2048,11 @@ Channel.prototype.handleJumpTo = function (user, data) { var to = this.playlist.items.find(data); var title = ""; - if (to != null) { + if (to !== false) { title = " to " + to.media.title; + this.logger.log("[playlist] " + user.name + " skipped" + title); + this.playlist.jump(data); } - this.logger.log("[playlist] " + user.name + " skipped" + title); - this.playlist.jump(data); }; /** diff --git a/lib/web/webserver.js b/lib/web/webserver.js index 26ae10f8..818d74f8 100644 --- a/lib/web/webserver.js +++ b/lib/web/webserver.js @@ -231,7 +231,7 @@ function static(dir) { req.header("user-agent").toLowerCase() === "zmeu") { res.send("This server disallows requests from ZmEu."); } else { - res.send("The request " + req.route.method.toUpperCase() + " " + + res.send("The request " + req.method.toUpperCase() + " " + req.path + " looks pretty fishy to me. Double check that " + "you typed it correctly."); } diff --git a/www/js/callbacks.js b/www/js/callbacks.js index 59cc34a6..11ba5ab6 100644 --- a/www/js/callbacks.js +++ b/www/js/callbacks.js @@ -811,6 +811,8 @@ Callbacks = { return; } + var shouldResize = $("#ytapiplayer").html() === ""; + if (PLAYER && typeof PLAYER.getVolume === "function") { PLAYER.getVolume(function (v) { if (typeof v === "number") { @@ -865,6 +867,10 @@ Callbacks = { loadMediaPlayer(data); } + if ($("#ytapiplayer").height() != VHEIGHT) { + resizeStuff(); + } + handleMediaUpdate(data); }, @@ -1003,82 +1009,6 @@ Callbacks = { listPlaylists: function(data) { $("#userpl_list").data("entries", data); formatUserPlaylistList(); - return; - if(data.error) { - makeAlert("Error", data.error, "alert-danger") - .insertBefore($("#userpl_list")); - } - else { - var pls = data; - pls.sort(function(a, b) { - var x = a.name.toLowerCase(); - var y = b.name.toLowerCase(); - if(x < y) return -1; - if(x > y) return 1; - return 0; - }); - $("#userpl_list").html(""); - for(var i = 0; i < pls.length; i++) { - var li = $("
  • ").appendTo($("#userpl_list")) - .addClass("well"); - li.data("pl-name", pls[i].name); - $("
    ").text(pls[i].name).appendTo(li) - .css("float", "left") - .css("margin-left", "1em"); - var metastr = pls[i].count + " item"; - if(pls[i].count != 1) { - metastr += "s"; - } - metastr +=", playtime " + pls[i].duration; - $("
    ").text(metastr) - .css("float", "right") - .appendTo(li); - var bg = $("
    ").addClass("btn-group") - .css("float", "left") - .prependTo(li); - var del = $("