Prepare WM Tippspiel

This commit is contained in:
2026-05-27 23:36:18 +02:00
parent 26ba216a32
commit 062160e09e
10 changed files with 292 additions and 236 deletions
@@ -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;
}
}