Prepare WM Tippspiel
This commit is contained in:
@@ -157,6 +157,9 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
ArrayList<APIFootballMatch> apiFootballMatches) {
|
||||
|
||||
ArrayList<APIFootballMatch> missingMatches = new ArrayList<>();
|
||||
if(!validateApiFootballTeamIds(apiFootballMatches)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
|
||||
if(getMatchingMatch(apiFootballMatch, tlwMatches) == null) {
|
||||
@@ -316,4 +319,20 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
public String getBeautifulInfo() {
|
||||
return this.beautifulInfo;
|
||||
}
|
||||
|
||||
private boolean validateApiFootballTeamIds(ArrayList<APIFootballMatch> apiFootballMatches) {
|
||||
|
||||
int missing = 0;
|
||||
|
||||
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
|
||||
if(TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.HOME) == null) {
|
||||
missing++;
|
||||
}
|
||||
if(TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.GUEST) == null) {
|
||||
missing++;
|
||||
}
|
||||
}
|
||||
|
||||
return missing == 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user