Fix all ranks being set to zero.

master
Icedream 2018-06-16 23:18:26 +02:00
parent c8de797166
commit 202cae1b28
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
2 changed files with 6 additions and 3 deletions

View File

@ -588,17 +588,20 @@ func main() {
goalDiffPrefix = "" goalDiffPrefix = ""
} }
// HACK - get team name from two diff fields // HACK - get team name and rank from two diff fields
var teamName string var teamName string
var rank uint8
switch v := standing.(type) { switch v := standing.(type) {
case footballdata.TeamLeagueStatisticsInStanding: case footballdata.TeamLeagueStatisticsInStanding:
teamName = v.TeamName teamName = v.TeamName
rank = v.Position
case footballdata.TeamLeagueStatisticsInStandings: case footballdata.TeamLeagueStatisticsInStandings:
teamName = v.Team teamName = v.Team
rank = v.Rank
} }
data = append(data, []string{ data = append(data, []string{
fmt.Sprintf("%d", actualStanding.Position), fmt.Sprintf("%d", rank),
teamName, teamName,
fmt.Sprintf("%d", actualStanding.PlayedGames), fmt.Sprintf("%d", actualStanding.PlayedGames),
fmt.Sprintf("%d:%d", actualStanding.Goals, actualStanding.GoalsAgainst), fmt.Sprintf("%d:%d", actualStanding.Goals, actualStanding.GoalsAgainst),

@ -1 +1 @@
Subproject commit 76a795f444e4ad1f8936520fc750402e7c985e2a Subproject commit eff192f192a55fb76a2711ff8e4e44015e5f5e58