Skip to content

Commit d543008

Browse files
committed
Also pick up MLB.tv free games
1 parent 6b6696c commit d543008

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

statsapi/__init__.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def schedule(
7777
params.update(
7878
{
7979
"sportId": str(sportId),
80-
"hydrate": "decisions,probablePitcher(note),linescore,broadcasts",
80+
"hydrate": "decisions,probablePitcher(note),linescore,broadcasts,game(content(media(epg)))",
8181
}
8282
)
8383

@@ -129,6 +129,8 @@ def schedule(
129129
)
130130
),
131131
}
132+
if game["content"].get("media", {}).get("freeGame", False):
133+
game_info["national_broadcasts"].append("MLB.tv Free Game")
132134
if game_info["status"] in ["Final", "Game Over"]:
133135
if game.get("isTie"):
134136
game_info.update({"winning_team": "Tie", "losing_Team": "Tie"})
@@ -1346,20 +1348,8 @@ def standings(
13461348
for div in divisions.values():
13471349
standings += div["div_name"] + "\n"
13481350
if include_wildcard:
1349-
standings += (
1350-
"{:^4} {:<21} {:^3} {:^3} {:^4} {:^4} {:^7} {:^5} {:^4}\n".format(
1351-
*[
1352-
"Rank",
1353-
"Team",
1354-
"W",
1355-
"L",
1356-
"GB",
1357-
"(E#)",
1358-
"WC Rank",
1359-
"WC GB",
1360-
"(E#)",
1361-
]
1362-
)
1351+
standings += "{:^4} {:<21} {:^3} {:^3} {:^4} {:^4} {:^7} {:^5} {:^4}\n".format(
1352+
*["Rank", "Team", "W", "L", "GB", "(E#)", "WC Rank", "WC GB", "(E#)",]
13631353
)
13641354
for t in div["teams"]:
13651355
standings += "{div_rank:^4} {name:<21} {w:^3} {l:^3} {gb:^4} {elim_num:^4} {wc_rank:^7} {wc_gb:^5} {wc_elim_num:^4}\n".format(

0 commit comments

Comments
 (0)