Skip to content

Commit

Permalink
Fix play-by-play logos in exhibition games - use small logo when avai…
Browse files Browse the repository at this point in the history
…lable, and never use teamInfoCache logo. Fixes #460
  • Loading branch information
dumbmatter committed Dec 26, 2023
1 parent a8704e0 commit 1f1d567
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
7 changes: 0 additions & 7 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
new logos
- logos page
- blog
- rebranding
- providence in historical leagues
- hockey default teams (CIN -> CLB, CHA -> RAL)

GOAT formula "ewaPeak" returns -infinity for some reason for guys who never played https://discord.com/channels/290013534023057409/290015591216054273/1188159918952423494

setting for overtime period length
Expand Down
1 change: 1 addition & 0 deletions src/worker/api/exhibitionGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ const getSeasonInfoLeague = async ({
return {
abbrev: teamSeason.abbrev ?? t.abbrev,
imgURL: teamSeason.imgURL ?? t.imgURL,
imgURLSmall: teamSeason.imgURLSmall ?? t.imgURLSmall,
region: teamSeason.region ?? t.region,
name: teamSeason.name ?? t.name,
pop: teamSeason.pop ?? t.pop,
Expand Down
4 changes: 3 additions & 1 deletion src/worker/views/gameLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ export const setTeamInfo = async (
(Object.hasOwn(g, "teamInfoCache")
? g.get("teamInfoCache")[t.tid]?.imgURL
: "");

// Extra teamSeasonOverride check here because this could intentionally be undefined in the provided teamSeason
t.imgURLSmall =
teamSeason.imgURLSmall ??
(Object.hasOwn(g, "teamInfoCache")
(Object.hasOwn(g, "teamInfoCache") && !teamSeasonOverride
? g.get("teamInfoCache")[t.tid]?.imgURLSmall
: undefined);
t.colors = teamSeason.colors;
Expand Down

0 comments on commit 1f1d567

Please sign in to comment.