Fixed issue with added a playlist to a recently cleared channel

This commit is contained in:
Kasper Rynning-Tønnesen
2017-10-30 12:26:15 +01:00
parent bbce393a5f
commit e08c72f98c
3 changed files with 14 additions and 4 deletions

View File

@@ -21,8 +21,8 @@ function add_function(arr, coll, guid, offline, socket) {
var last = arr.num == arr.total - 1;
var num = arr.num;
var total = arr.total;
db.collection(coll).find({views:{$exists:true}}, function(err, docs)
{
/*db.collection(coll).find({views:{$exists:true}}, function(err, docs)
{*/
conf = docs;
if(docs !== null && docs.length !== 0 && ((docs[0].addsongs === true && (hash == docs[0].adminpass || docs[0].adminpass === "")) ||
docs[0].addsongs === false))
@@ -135,7 +135,7 @@ function add_function(arr, coll, guid, offline, socket) {
socket.emit("toast", "listhaspass");
}
}
});
//});
} else {
socket.emit("auth_required");
}

View File

@@ -12,6 +12,7 @@ var conf = [];
var private_channel = false;
var music = 0;
var frontpage = 1;
var empty_clear = false;
var adminpass = "";
var showDiscovery = false;
var temp_name = "";

View File

@@ -153,6 +153,13 @@ var Player = {
}
duration = Player.player.getDuration();
}
if(Object.keys(obj).length == 0) {
paused = false;
empty_clear = true;
} else {
empty_clear = false;
}
},
onPlayerStateChange: function(newState) {
@@ -208,7 +215,9 @@ var Player = {
$("#playpause").css("pointer-events", "all");
$("#channel-load").css("display", "none");
}
paused = true;
if(!empty_clear) {
paused = true;
}
if(window.location.pathname != "/") Playercontrols.play_pause_show();
mobile_beginning = true;
}