tweak puzzle disabler
parent
d6c0cfa752
commit
5ebd8a4549
|
@ -3,13 +3,12 @@ var count = 0;
|
||||||
puzzles.find().forEach(function(p) {
|
puzzles.find().forEach(function(p) {
|
||||||
var parts = p.fen.split(/\s/);
|
var parts = p.fen.split(/\s/);
|
||||||
var pieceCount = parts[0].split(/[nbrqkp]/i).length - 1;
|
var pieceCount = parts[0].split(/[nbrqkp]/i).length - 1;
|
||||||
if (pieceCount < 9) {
|
if (pieceCount < 9 && p.vote.sum < 50) {
|
||||||
count++;
|
count++;
|
||||||
puzzles.update({
|
puzzles.update({
|
||||||
_id: p._id
|
_id: p._id
|
||||||
}, {
|
}, {
|
||||||
$set: {
|
$set: {
|
||||||
vote_backup: p.vote,
|
|
||||||
vote: {
|
vote: {
|
||||||
up: NumberInt(0),
|
up: NumberInt(0),
|
||||||
down: NumberInt(0),
|
down: NumberInt(0),
|
||||||
|
|
Loading…
Reference in New Issue