Add api football files updater
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user