diff --git a/channel.js b/channel.js index 3fa8797f..059d8337 100644 --- a/channel.js +++ b/channel.js @@ -128,6 +128,11 @@ Channel.prototype.loadMysql = function() { Logger.syslog.log("Channel " + this.name + " is unregistered."); return; } + // [](/picard) I didn't realize that MySQL wasn't case sensitive. + // My bad. + else if(rows[0].name != this.name) { + this.name = rows[0].name; + } this.registered = true; // Load library @@ -674,12 +679,13 @@ Channel.prototype.unqueue = function(data) { pos: data.pos }); - if(data.pos < this.currentPosition) { - this.currentPosition--; - } if(data.pos == this.currentPosition) { this.currentPosition--; this.playNext(); + return; + } + if(data.pos < this.currentPosition) { + this.currentPosition--; } } diff --git a/user.js b/user.js index 07a8cf6a..3a8f2d2e 100644 --- a/user.js +++ b/user.js @@ -252,7 +252,12 @@ User.prototype.initCallbacks = function() { this.socket.on("chatFilter", function(data) { if(Rank.hasPermission(this, "chatFilter")) { if(data.cmd && data.cmd == "update" && this.channel != null) { - data.filter[0] = new RegExp(data.filter[0], "g"); + try { + data.filter[0] = new RegExp(data.filter[0], "g"); + } + catch(e) { + return; + } this.channel.updateFilter(data.filter); } else if(data.cmd && data.cmd == "remove" && this.channel != null) { diff --git a/www/assets/js/functions.js b/www/assets/js/functions.js index ed4cb0c8..93e02cc7 100644 --- a/www/assets/js/functions.js +++ b/www/assets/js/functions.js @@ -484,6 +484,7 @@ function removeCurrentPlayer(){ } function parseVideoURL(url){ + url = url.trim() if(typeof(url) != "string") return null; if(url.indexOf("youtu.be") != -1 || url.indexOf("youtube.com") != -1) { @@ -505,21 +506,18 @@ function parseVideoURL(url){ } function parseYTURL(url) { - url = url.replace("feature=player_embedded&", ""); - if(url.indexOf("&list=") != -1) - url = url.substring(0, url.indexOf("&list=")); - var m = url.match(/youtube\.com\/watch\?v=([^&]+)/); + var m = url.match(/v=([^]+)/); if(m) { // Extract ID return m[1]; } - var m = url.match(/youtu\.be\/([^&]+)/); + var m = url.match(/youtu\.be\/([^]+)/); if(m) { // Extract ID return m[1]; } // Final try - var m = url.match(/v=([^&]*)/); + var m = url.match(/([^]*)/); if(m) { // Extract ID return m[1]; @@ -727,6 +725,12 @@ function updateChatFilters(entries) { .appendTo($("