Add support for API Football config without result and placeholder as fallback

This commit is contained in:
2020-10-31 21:46:30 +01:00
parent 7d9fc5aac1
commit 7f98b928bd
5 changed files with 22 additions and 9 deletions
@@ -1,6 +1,7 @@
package de.jeyp91.tippliga;
import de.jeyp91.App;
import de.jeyp91.StatusHolder;
import de.jeyp91.TeamIDMatcher;
import de.jeyp91.apifootball.APIFootballMatch;
import de.jeyp91.apifootball.APIFootballMatchesProvider;
@@ -170,6 +171,10 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
{
for(APIFootballMatch apiFootballMatch : apiFootballMatches) {
TLWMatch tlwMatch = getMatchingMatch(apiFootballMatch, tlwMatches);
if(tlwMatch == null) {
StatusHolder.setError();
logger.error("Did not find match to update");
}
tlwMatch.setMatchDateTime(apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19));
}
}