<commit_before>var currentQueue = []; //Fill with Song objects

var manage = function(socket,lobby){
	console.log("Now managing " + lobby.title);
	socket.on("add_song",function(song){
		lobby.queue.push(song);
		console.log("Song added: "+ song + " - " + lobby.queue);

		//Let everyone else know
		lobby.namespace.emit("queue",lobby.queue);
	});
}

exports.manage = manage;<commit_msg>Added support for song ending and song removal<commit_after>var manage = function(socket,lobby){
    console.log("Now managing " + lobby.title);
    socket.on("add_song",function(song){
        lobby.queue.push(song);
        console.log("Song added: "+ song + " - " + lobby.queue);

        //Let everyone else know
        lobby.namespace.emit("queue",lobby.queue);
    });

    socket.on("remove_song",function(song){
        for(var i=0;i<lobby.queue.length;i++){
            if(song.url==lobby.queue[i].url){
                lobby.queue.splice(i,1);
            }
        }

        //Let everyone else know
        lobby.namespace.emit("queue",lobby.queue);
    });

    socket.on("song_ended",function(song){
        lobby.queue.shift();
        lobby.namespace.emit("song",lobby.queue[0]);
        lobby.namespace.emit("queue",lobby.queue);
    });
}

exports.manage = manage;
{'fraction_non_alphanumeric': 0.16929133858267717, 'fraction_numerical': 0.002362204724409449, 'mean_word_length': 2.959501557632399, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4083438', 'n_tokens_mistral': 422, 'n_tokens_neox': 401, 'n_words': 64}