Add api football files updater

This commit is contained in:
2020-10-07 22:14:13 +02:00
parent bce0f3800c
commit f22f9a929b
18 changed files with 15808 additions and 1048 deletions

View File

@@ -17,6 +17,8 @@ public class APIFootballMatch extends BaseMatch {
private int matchId;
private int leagueId;
private String matchStatus;
private String teamNameHome;
private String teamNameGuest;
public APIFootballMatch(JSONObject json, int season) {
this.season = season;
@@ -25,6 +27,8 @@ public class APIFootballMatch extends BaseMatch {
this.leagueId = Integer.parseInt(json.get("league_id").toString());
this.teamIdHome = Integer.parseInt(((JSONObject) json.get("homeTeam")).get("team_id").toString());
this.teamIdGuest = Integer.parseInt(((JSONObject) json.get("awayTeam")).get("team_id").toString());
this.teamNameHome = ((JSONObject) json.get("homeTeam")).get("team_name").toString();
this.teamNameGuest = ((JSONObject) json.get("awayTeam")).get("team_name").toString();
this.goalsHome = getNumberOrNull(json.get("goalsHomeTeam"));
this.goalsGuest = getNumberOrNull(json.get("goalsAwayTeam"));
this.matchday = getMatchdayFromRoundString(json.get("round").toString(), this.leagueId);
@@ -73,4 +77,12 @@ public class APIFootballMatch extends BaseMatch {
private Integer getNumberOrNull(Object object) {
return object != null ? Integer.parseInt(object.toString()) : null;
}
public String getTeamNameHome() {
return this.teamNameHome;
}
public String getTeamNameGuest() {
return this.teamNameGuest;
}
}