tweak puzzle disabler

puzzle2
Thibault Duplessis 2016-09-29 11:03:49 +02:00
parent d6c0cfa752
commit 5ebd8a4549
1 changed files with 1 additions and 2 deletions

View File

@ -3,13 +3,12 @@ var count = 0;
puzzles.find().forEach(function(p) {
var parts = p.fen.split(/\s/);
var pieceCount = parts[0].split(/[nbrqkp]/i).length - 1;
if (pieceCount < 9) {
if (pieceCount < 9 && p.vote.sum < 50) {
count++;
puzzles.update({
_id: p._id
}, {
$set: {
vote_backup: p.vote,
vote: {
up: NumberInt(0),
down: NumberInt(0),