Add auto update of results
This commit is contained in:
@@ -220,30 +220,6 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
}
|
||||
}
|
||||
|
||||
private TLWMatch getMatchingMatch(APIFootballMatch apiFootballMatch, ArrayList<TLWMatch> tlwMatches) throws NullPointerException{
|
||||
int foundMatches = 0;
|
||||
TLWMatch matchingMatch = null;
|
||||
for(TLWMatch match : tlwMatches) {
|
||||
Integer apiTeamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.HOME);
|
||||
Integer apiTeamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.GUEST);
|
||||
int tlwTeamIdHome = match.getTeamIdHome();
|
||||
int tlwTeamIdGuest = match.getTeamIdGuest();
|
||||
|
||||
if(apiTeamIdHome == null
|
||||
|| apiTeamIdGuest == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
if(
|
||||
apiTeamIdHome.equals(tlwTeamIdHome)
|
||||
&& apiTeamIdGuest.equals(tlwTeamIdGuest)
|
||||
) {
|
||||
foundMatches++;
|
||||
matchingMatch = match;
|
||||
}
|
||||
}
|
||||
return matchingMatch;
|
||||
}
|
||||
|
||||
public ArrayList<TLWMatch> getTLWMatchesUpdated() {
|
||||
return this.tlwMatchesUpdated;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user