<commit_before>var async = require('async');


/*
 * GET Games listing.
 */

function Game(config){
	this.config = config;

}


module.exports = Game;

Game.prototype.list = function(req, res){

	var that = this;
	var games = [];
	var players = [];

	async.parallel([
		function(pcb){ // Get All Available Players
			that.config.Players.find(function (err, players) {
				if (err){ // TODO handle err
					console.log(err)
				} else{
					pcb(null,players)
				}

			});
		},
		function(pcb){ // Get all Games
			that.config.Games.find(function (err, games) {
				if (err){ // TODO handle err
					console.log(err)
				} else{
					console.log("games Found", games);
					pcb(null,games)

				}

			});
		}
	], function(error, args){

		var myPlayers = args[0];
		var myGames = args[1];

		myGames.forEach(function(game, i){
			myPlayers.forEach(function(player, j){
				if(player["_id"] == game.redPlayer){
					game.redPlayerDetails = player;
				}
				if(player["_id"] == game.bluePlayer){
					game.bluePlayerDetails = player;
				}
			});
		});

		res.render('games', { title: 'Games Played', games: myGames, players: myPlayers });
	});<commit_msg>stop spaming my log<commit_after>var async = require('async');


/*
 * GET Games listing.
 */

function Game(config){
	this.config = config;

}


module.exports = Game;

Game.prototype.list = function(req, res){

	var that = this;
	var games = [];
	var players = [];

	async.parallel([
		function(pcb){ // Get All Available Players
			that.config.Players.find(function (err, players) {
				if (err){ // TODO handle err
					console.log(err)
				} else{
					pcb(null,players)
				}

			});
		},
		function(pcb){ // Get all Games
			that.config.Games.find(function (err, games) {
				if (err){ // TODO handle err
					console.log(err)
				} else{
					pcb(null,games)

				}

			});
		}
	], function(error, args){

		var myPlayers = args[0];
		var myGames = args[1];

		myGames.forEach(function(game, i){
			myPlayers.forEach(function(player, j){
				if(player["_id"] == game.redPlayer){
					game.redPlayerDetails = player;
				}
				if(player["_id"] == game.bluePlayer){
					game.bluePlayerDetails = player;
				}
			});
		});

		res.render('games', { title: 'Games Played', games: myGames, players: myPlayers });
	});
{'fraction_non_alphanumeric': 0.16754617414248021, 'fraction_numerical': 0.001759014951627089, 'mean_word_length': 2.929188255613126, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1258163', 'n_tokens_mistral': 967, 'n_tokens_neox': 779, 'n_words': 170}