Exemplo n.º 1
0
 var complete = function(tot, curr){
     if(tot == curr)
     {
         List.send_list(coll, undefined, false, true, false);
         List.getNextSong(coll, undefined);
     }
 };
Exemplo n.º 2
0
                        db.collection(coll).find({now_playing:false}).forEach(function(err, docs){
                            if(!docs){
                                List.send_list(coll, undefined, false, true, false, true);
                                socket.emit("toast", "shuffled");

                                return;
                            }else{
                                num = Math.floor(Math.random()*1000000);
                                db.collection(coll).update({id:docs.id}, {$set:{added:num}});
                            }
                        });
Exemplo n.º 3
0
 db.collection(coll).update({id: id}, new_song, {upsert: true}, function(err, docs){
     new_song._id = "asd";
     if(np) {
         List.send_list(coll, undefined, false, true, false);
         db.collection(coll + "_settings").update({ id: "config" }, {$set:{startTime: Functions.get_time()}});
         List.send_play(coll, undefined);
         var thumbnail = arr.thumbnail != undefined ? arr.thumbnail : undefined;
         Frontpage.update_frontpage(coll, id, title, thumbnail, arr.source);
         if(source != "soundcloud") Search.get_correct_info(new_song, coll, false);
         else if(source == "soundcloud") Search.get_genres_soundcloud(new_song, coll);
     } else {
         io.to(coll).emit("channel", {type: "added", value: new_song});
         if(source != "soundcloud") Search.get_correct_info(new_song, coll, true);
         else if(source == "soundcloud") Search.get_genres_soundcloud(new_song, coll);
     }
     db.collection("frontpage_lists").update({_id:coll}, {$inc:{count:1}, $set:{accessed: Functions.get_time()}}, {upsert:true}, function(err, docs){});
     List.getNextSong(coll, undefined);
 });
Exemplo n.º 4
0
 db.collection(coll).remove({views: {$exists: false}, type: "video"}, {multi: true}, function(err, succ) {
     List.send_list(coll, false, true, true, true);
     db.collection("frontpage_lists").update({_id: coll}, {$set: {count: 0, accessed: Functions.get_time()}}, {upsert: true}, function(err, docs) {});
     socket.emit("toast", "deleted_songs");
 });
Exemplo n.º 5
0
 db.collection("frontpage_lists").update({_id: channel}, {$set: {count: count}}, function(e, d) {
     List.send_list(channel, undefined, false, true, false);
     List.send_play(channel, undefined);
     socket.emit("toast", "addedplaylist");
     _db.close();
 })