add fixme
This commit is contained in:
1
game.go
1
game.go
@@ -11,6 +11,7 @@ type Game struct {
|
|||||||
func (g *Game) Update(feed *statsapi.FeedResponse) {
|
func (g *Game) Update(feed *statsapi.FeedResponse) {
|
||||||
homeScore, _ := (*feed)["liveData"].(map[string]any)["linescore"].(map[string]any)["teams"].(map[string]any)["home"].(map[string]any)["runs"].(float64)
|
homeScore, _ := (*feed)["liveData"].(map[string]any)["linescore"].(map[string]any)["teams"].(map[string]any)["home"].(map[string]any)["runs"].(float64)
|
||||||
awayScore, _ := (*feed)["liveData"].(map[string]any)["linescore"].(map[string]any)["teams"].(map[string]any)["away"].(map[string]any)["runs"].(float64)
|
awayScore, _ := (*feed)["liveData"].(map[string]any)["linescore"].(map[string]any)["teams"].(map[string]any)["away"].(map[string]any)["runs"].(float64)
|
||||||
|
// FIXME: currentPlay/result doesn't always have description
|
||||||
desc, _ := (*feed)["liveData"].(map[string]any)["plays"].(map[string]any)["currentPlay"].(map[string]any)["result"].(map[string]any)["description"].(string)
|
desc, _ := (*feed)["liveData"].(map[string]any)["plays"].(map[string]any)["currentPlay"].(map[string]any)["result"].(map[string]any)["description"].(string)
|
||||||
|
|
||||||
g.HomeScore = uint(homeScore)
|
g.HomeScore = uint(homeScore)
|
||||||
|
|||||||
Reference in New Issue
Block a user