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

@@ -110,8 +110,8 @@ public class TLWMatch extends BaseMatch{
this.league = league;
this.matchday = matchday;
this.matchNo = matchNo;
this.teamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdHome());
this.teamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdGuest());
this.teamIdHome = this.getTeamIdHomeFromApiFootballMatch(apiFootballMatch);
this.teamIdGuest = this.getTeamIdGuestFromApiFootballMatch(apiFootballMatch);
this.goalsHome = apiFootballMatch.getGoalsHome();
this.goalsGuest = apiFootballMatch.getGoalsGuest();
this.matchDatetime = apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19);
@@ -270,4 +270,20 @@ public class TLWMatch extends BaseMatch{
this.goalsGuest = apiFootballMatch.getGoalsGuest();
this.matchDatetime = apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19);
}
private Integer getTeamIdHomeFromApiFootballMatch(APIFootballMatch match) {
Integer id = TeamIDMatcher.getTippligaIdFromApiFootballId(match.getTeamIdHome());
if(id == null) {
System.out.println("Could not find id " + match.getTeamIdHome() + " for " + match.getTeamNameHome());
}
return id;
}
private Integer getTeamIdGuestFromApiFootballMatch(APIFootballMatch match) {
Integer id = TeamIDMatcher.getTippligaIdFromApiFootballId(match.getTeamIdGuest());
if(id == null) {
System.out.println("Could not find id " + match.getTeamIdGuest() + " for " + match.getTeamNameGuest());
}
return id;
}
}