mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Maybe fix for skip issue
This commit is contained in:
@@ -401,34 +401,16 @@ function change_song(coll, id, np_id)
|
||||
})
|
||||
}else
|
||||
{
|
||||
if(id === undefined){
|
||||
//console.log("undef");
|
||||
db.collection(coll).update({now_playing:true},
|
||||
{$set:{
|
||||
now_playing:false,
|
||||
votes:0,
|
||||
guids:[]
|
||||
}}, function(err, docs)
|
||||
},{multi:true}}, function(err, docs)
|
||||
{
|
||||
change_song_post(coll);
|
||||
});
|
||||
}else{
|
||||
db.collection(coll).find({id:id}, function(err, docs){
|
||||
if(startTime+docs[0]["duration"]<=get_time()-1)
|
||||
{
|
||||
db.collection(coll).update({now_playing:true, id:id},
|
||||
{$set:{
|
||||
now_playing:false,
|
||||
votes:0,
|
||||
guids:[]
|
||||
}}, function(err, docs)
|
||||
{
|
||||
change_song_post(coll);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user