mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
fix: resolve PR commits
This commit is contained in:
parent
47941026f2
commit
5261325771
@ -105,16 +105,16 @@ func (widget *Widget) GetStandings(leagueId int) string {
|
||||
return fmt.Sprintf("Error fetching standings")
|
||||
}
|
||||
|
||||
if len(l.Standings) > 0 {
|
||||
if len(l.Standings) == 0 {
|
||||
return fmt.Sprintf("Error fetching standings")
|
||||
}
|
||||
|
||||
for _, i := range l.Standings[0].Table {
|
||||
if i.Position <= widget.settings.standingCount {
|
||||
row := []string{strconv.Itoa(i.Position), i.Team.Name, strconv.Itoa(i.PlayedGames), strconv.Itoa(i.Won), strconv.Itoa(i.Draw), strconv.Itoa(i.Lost), strconv.Itoa(i.GoalDifference), strconv.Itoa(i.Points)}
|
||||
tStandings.Append(row)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return fmt.Sprintf("Error fetching standings")
|
||||
}
|
||||
|
||||
tStandings.Render()
|
||||
content += buf.String()
|
||||
@ -151,7 +151,9 @@ func (widget *Widget) GetMatches(leagueId int) string {
|
||||
return fmt.Sprintf("Error fetching matches: %s", err.Error())
|
||||
}
|
||||
|
||||
if len(l.Matches) != 0 {
|
||||
if len(l.Matches) == 0 {
|
||||
return fmt.Sprintf("Error fetching matches")
|
||||
}
|
||||
|
||||
for _, m := range l.Matches {
|
||||
|
||||
@ -177,7 +179,6 @@ func (widget *Widget) GetMatches(leagueId int) string {
|
||||
content += "\nUpcoming Matches:\n\n"
|
||||
content += scheduledBuf.String()
|
||||
}
|
||||
}
|
||||
|
||||
return content
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user