diff --git a/server/server.js b/server/server.js index ff583348..ef5afd61 100755 --- a/server/server.js +++ b/server/server.js @@ -306,11 +306,12 @@ io.on('connection', function(socket){ db.collection(coll).find({skip: false}, function(err, docs){ if(docs.length == 1) { - if(lists[coll].length/2 <= docs[0]["skips"].length+1 && !contains(docs[0]["skips"], guid) && get_time() - docs[0]["startTime"] >= 10) + if(lists[coll].length/2 <= docs[0]["skips"].length+1 && !contains(docs[0]["skips"], guid) && (get_time() - docs[0]["startTime"] >= 10 + || lists[coll].length != 2)) { change_song(coll); socket.emit("toast", "skip"); - }else if(get_time() - docs[0]["startTime"] < 10) + }else if(get_time() - docs[0]["startTime"] < 10 && lists[coll].length == 2) { socket.emit("toast", "notyetskip"); }else if(!contains(docs[0]["skips"], guid) && get_time() - docs[0]["startTime"] >= 30){ diff --git a/static/js/admin.js b/static/js/admin.js index 28e4cbc0..3800c548 100755 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -40,7 +40,7 @@ socket.on("toast", function(msg) msg=rnd(["Skipping is democratic, only one vote per person!", "More people have to vote to skip, not just you!", "Get someone else to skip too! You can't do it on yourself."]) break; case "notyetskip": - msg="Skipping is disabled the first 10 seconds of the video."; + msg="Skipping is disabled the first 10 seconds."; break; } Materialize.toast(msg, 4000);