Skip to content

Commit

Permalink
Fixed a bug where Week 17 posts were using Week 15 scores instead of 16
Browse files Browse the repository at this point in the history
  • Loading branch information
andykant committed Dec 28, 2021
1 parent b2d8302 commit 9ca3628
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/the-horn-live.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ function updateTHPP(thpp) {
updateTHPP(team.thpp);
});

// Retrieve regular season average and week 15 scores.
// Retrieve regular season average and week 16 scores.
if (WEEK === '17') {
await Promise.all(
leagues.map(async ({id}) => {
// Grab the games with Horn teams.
const scoreboard = await fetchScoreboard({id, week: 15});
const scoreboard = await fetchScoreboard({id, week: 16});
const games = scoreboard.games.filter(game =>
teams.find(team => team.id === game.away.id || team.id === game.home.id)
);

// Cache average and week 15 scores.
// Cache average and week 16 scores.
games.forEach(game => {
const side = teams.find(team => team.id === game.home.id) ? 'home' : 'away';
const team = teams.find(team => team.id === game[side].id);
Expand Down

0 comments on commit 9ca3628

Please sign in to comment.