Fixed issue with importing playlist on passwordprotected playlist didnt inform the user

This commit is contained in:
Kasper Rynning-Tønnesen
2017-07-22 14:23:43 +02:00
parent 7298df62a9
commit a5bb390479
4 changed files with 14 additions and 14 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
View File
@@ -64,6 +64,14 @@ var Admin = {
$("#description_form").css("display", "none"); $("#description_form").css("display", "none");
$('#chan_thumbnail').tooltip("remove"); $('#chan_thumbnail').tooltip("remove");
w_p = true; w_p = true;
if(!$("#playlist_loader").hasClass("hide")) {
$("#playlist_loader").addClass("hide");
}
if(!$("#playlist_loader_spotify").hasClass("hide")) {
$("#playlist_loader_spotify").addClass("hide");
}
$("#import_spotify").removeClass("hide");
$("#import").removeClass("hide");
break; break;
case "noskip": case "noskip":
msg=Helper.rnd(["Only Admins can skip songs, peasant!", "You have to log in to skip songs on this channel", "Try clicking the settings icon and logging in before you skip"]); msg=Helper.rnd(["Only Admins can skip songs, peasant!", "You have to log in to skip songs on this channel", "Try clicking the settings icon and logging in before you skip"]);
+4 -12
View File
@@ -457,14 +457,7 @@ io.on('connection', function(socket){
socket.on('end', function(obj) socket.on('end', function(obj)
{ {
if(chromecast_object) {
console.log("chromecast_object");
console.log(obj);
}
if(typeof(obj) !== 'object') { if(typeof(obj) !== 'object') {
socket.emit('update_required');
console.log("Error with end object");
console.log(obj);
return; return;
} }
id = obj.id; id = obj.id;
@@ -480,16 +473,12 @@ io.on('connection', function(socket){
coll = encodeURIComponent(coll).replace(/\W/g, ''); coll = encodeURIComponent(coll).replace(/\W/g, '');
coll = filter.clean(coll); coll = filter.clean(coll);
} catch(e) { } catch(e) {
console.log("Error with setting coll");
console.log(obj);
return; return;
} }
} }
if(coll == "" || coll == undefined || coll == null) { if(coll == "" || coll == undefined || coll == null) {
socket.emit("update_required"); socket.emit("update_required");
console.log("Error with coll");
console.log(obj);
return; return;
} }
@@ -566,7 +555,6 @@ io.on('connection', function(socket){
db.collection(coll).find({views:{$exists:true}}, function(err, docs) db.collection(coll).find({views:{$exists:true}}, function(err, docs)
{ {
conf = docs; conf = docs;
if(docs !== null && docs.length !== 0 && ((docs[0].addsongs === true && (hash == docs[0].adminpass || docs[0].adminpass === "")) || if(docs !== null && docs.length !== 0 && ((docs[0].addsongs === true && (hash == docs[0].adminpass || docs[0].adminpass === "")) ||
docs[0].addsongs === false)) docs[0].addsongs === false))
{ {
@@ -677,6 +665,10 @@ io.on('connection', function(socket){
} }
}); });
//socket.emit("toast", "listhaspass"); //socket.emit("toast", "listhaspass");
} else if (full_list){
if(arr.num == 0) {
socket.emit("toast", "listhaspass");
}
} }
}); });
} else { } else {