From 732255a26f90d13536658dd5504b368bd339befc Mon Sep 17 00:00:00 2001 From: Hope Casey-Allen Date: Sun, 3 Dec 2017 23:38:41 -0800 Subject: [PATCH] Added cell height to analysis cells --- index.css | 1 + index.js | 2 +- server.js | 20 ++++++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/index.css b/index.css index 9623f77..2752b03 100644 --- a/index.css +++ b/index.css @@ -67,6 +67,7 @@ .analysis-cell { vertical-align: top; width: 1%; + height: 350px; padding: 15px; } diff --git a/index.js b/index.js index 25600d5..182e338 100644 --- a/index.js +++ b/index.js @@ -472,7 +472,7 @@ function getRole(dataRole, dataLane) { if (dataRole === "DUO_CARRY") { return "ADC"; } - if (dataRole === "DUO") { + if (dataRole === "DUO" || dataRole === "SOLO" || dataRole === "NONE") { return "Bot lane - unknown role"; } } diff --git a/server.js b/server.js index f5d1628..5a2c408 100644 --- a/server.js +++ b/server.js @@ -8,7 +8,7 @@ let express = require('express'); let app = express(); let fs = require('fs'); -const port = 8082; +const port = 8080; let baseURL = 'https://na1.api.riotgames.com/lol/'; let apiKey = 'RGAPI-39f977f6-d666-4fc0-9c90-c61e53913c6e'; @@ -50,7 +50,7 @@ app.get('/all-match-data', function (req, res) { app.listen(port, function () { //TODO: remove prefetchData //prefetchFavoritesMatchData(); // YO don't call - //prefetchFavoritesTimelinesData(); // these at same time because asynchronous + prefetchFavoritesTimelinesData(); // these at same time because asynchronous //prefetchMasterLeagueMatchListData(); //prefetchTimelinesAndDetailsData(); @@ -65,7 +65,8 @@ function onMatchlistFileContent(filename, content, requestContext, gameIdCache) if (!gameIdCache[gameId]) { if (fs.existsSync(timelineFilename(gameId)) - || fs.existsSync(matchDetailsFilename(gameId))) { + && fs.existsSync(matchDetailsFilename(gameId))) { + console.log("found game cache id"); gameIdCache[gameId] = true; } else { @@ -84,6 +85,7 @@ function onMatchlistFileContent(filename, content, requestContext, gameIdCache) } } } + console.log("Number of matches for Pyro: " + matches.length); } function timelineFilename(matchId) { @@ -158,9 +160,10 @@ function prefetchFavoritesMatchData() { "Svenskeren", "HotGuySixPack", "Xmithie", "ILovePotatoChips", "xNaotox"]; */ - let summonerList = ["FlowerKitten", "AmrasArFeiniel", "Pyrolykos", "Tanonev", + /*let summonerList = ["FlowerKitten", "AmrasArFeiniel", "Pyrolykos", "Tanonev", "PerniciousRage", "ILovePotatoChips", "xNaotox", "Hikashikun", "Meteos"]; - +*/ + let summonerList = ["Pyrolykos"]; prefetchMatchListData(summonerList); } @@ -178,9 +181,10 @@ function prefetchMatchListData(summonerNames) { } function prefetchFavoritesTimelinesData() { - let summonerList = ["FlowerKitten", "AmrasArFeiniel", "Pyrolykos", "Tanonev", + /*let summonerList = ["FlowerKitten", "AmrasArFeiniel", "Pyrolykos", "Tanonev", "PerniciousRage", "ILovePotatoChips", "xNaotox", "Hikashikun", "Meteos"]; - +*/ + let summonerList = ["Pyrolykos"]; let requestContext = {requestId: 0}; let gameIdCache = {}; readFiles("./matchlist_data/", function(filename, content) { @@ -193,7 +197,7 @@ function prefetchFavoritesTimelinesData() { function fetchAndWriteMatchList(info, name, requestContext) { let promises = []; - for (let index = 0; index < 1000; index += 100) { + for (let index = 0; index < 5000; index += 100) { promises.push(new Promise((resolve, reject) => { setTimeout(() => fetchMatchlist(info.accountId, name, index, resolve), 1500 * requestContext.requestId); }));