mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed skip bug hopefully
This commit is contained in:
@@ -186,9 +186,9 @@ io.on('connection', function(socket){
|
|||||||
{
|
{
|
||||||
change_song(coll);
|
change_song(coll);
|
||||||
}else{
|
}else{
|
||||||
db.collection(coll).update({views:{$exists:true}}, {$push:{guids:guid}}, function(err, d){
|
db.collection(coll).update({views:{$exists:true}}, {$push:{skips:guid}}, function(err, d){
|
||||||
//reply with skips or something
|
//reply with skips or something
|
||||||
socket.emit("skipping", [docs[0]["skips"]+1, lists[coll].length])
|
socket.emit("toast", (docs[0]["skips"]+1) " of "+ Math.floor(lists[coll].length/2) + " are needed to skip!");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
@@ -361,7 +361,7 @@ function change_song_post(coll)
|
|||||||
guids:[],
|
guids:[],
|
||||||
added:get_time()}}, function(err, docs){
|
added:get_time()}}, function(err, docs){
|
||||||
db.collection(coll).update({views:{$exists:true}},
|
db.collection(coll).update({views:{$exists:true}},
|
||||||
{$set:{startTime:get_time()}}, function(err, docs){
|
{$set:{startTime:get_time(), skips:[]}}, function(err, docs){
|
||||||
sort_list(coll,undefined,true);
|
sort_list(coll,undefined,true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user