Fixed some minor playpause bugs on change song, and reimplemented desktop notifications. Also fixed height on playlist

This commit is contained in:
Kasper Rynning-Tønnesen
2015-04-13 16:40:48 +02:00
parent 1105fb3bcb
commit cf5802468e
4 changed files with 27 additions and 19 deletions

View File

@@ -327,18 +327,20 @@ function change_song_post(coll)
{$match:{now_playing:false}},
{$sort:{votes:-1, added:1}},
{$limit:1}], function(err, docs){
db.collection(coll).update({id:docs[0]["id"]},
{$set:{
now_playing:true,
votes:0,
guids:[],
added:get_time()}}, function(err, docs){
db.collection(coll).update({views:{$exists:true}},
{$set:{startTime:get_time()}}, function(err, docs){
sort_list(coll,undefined,true);
});
if(docs.length > 0){
db.collection(coll).update({id:docs[0]["id"]},
{$set:{
now_playing:true,
votes:0,
guids:[],
added:get_time()}}, function(err, docs){
db.collection(coll).update({views:{$exists:true}},
{$set:{startTime:get_time()}}, function(err, docs){
sort_list(coll,undefined,true);
});
});
});
}
});
}