Merge branch 'master' into feature/song2

This commit is contained in:
Kasper Rynning-Tønnesen
2017-11-09 20:15:23 +01:00
3 changed files with 14 additions and 14 deletions

View File

@@ -58,18 +58,18 @@ module.exports = function() {
}); });
socket.on("error_video", function(msg) { socket.on("error_video", function(msg) {
try { try {
var _list = msg.channel; var _list = msg.channel;
if(_list.length == 0) return; if(_list.length == 0) return;
coll = emojiStrip(_list).toLowerCase(); coll = emojiStrip(_list).toLowerCase();
coll = coll.replace("_", ""); coll = coll.replace("_", "");
coll = encodeURIComponent(coll).replace(/\W/g, ''); coll = encodeURIComponent(coll).replace(/\W/g, '');
coll = filter.clean(coll); coll = filter.clean(coll);
} catch(e) { } catch(e) {
return; return;
} }
Search.check_error_video(msg, coll); Search.check_error_video(msg, coll);
}); });
socket.on("get_spread", function(){ socket.on("get_spread", function(){
db.collection("connected_users").find({"_id": "total_users"}, function(err, tot) { db.collection("connected_users").find({"_id": "total_users"}, function(err, tot) {

View File

@@ -64,7 +64,6 @@ function check_error_video(msg, channel) {
for(var i = 0; i < resp.items.length; i++) { for(var i = 0; i < resp.items.length; i++) {
vid_url += resp.items[i].id.videoId + ","; vid_url += resp.items[i].id.videoId + ",";
} }
request({ request({
type: "GET", type: "GET",
url: vid_url url: vid_url

View File

@@ -982,7 +982,7 @@ var List = {
} }
}).error(function (xhr, errorType, exception) { }).error(function (xhr, errorType, exception) {
var errorMessage = exception || xhr.statusText || xhr.responseText; //var errorMessage = exception || xhr.statusText || xhr.responseText;
setTimeout(function() { setTimeout(function() {
socket.emit("error_video", {channel: chan.toLowerCase(), id: video_id, title: video_title}); socket.emit("error_video", {channel: chan.toLowerCase(), id: video_id, title: video_title});
}, 500); }, 500);
@@ -1036,6 +1036,7 @@ var List = {
return index; return index;
} }
}); });
return indexes[0]; return indexes[0];
} catch(e) {} } catch(e) {}
}, },