diff --git a/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java b/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java index 2082031..1fc96bd 100644 --- a/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java +++ b/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java @@ -51,10 +51,18 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase { logger.error("Not matching config!"); } - addMissingMatches(tlwMatchesUpdatedMatchday, apiFootballMatches); - updateMatchDateTimes(tlwMatchesUpdatedMatchday, apiFootballMatches); - updateShowTable(tlwMatchesUpdatedMatchday, apiFootballMatches); - updateStatus(tlwMatchesUpdatedMatchday); + LocalDateTime now = LocalDateTime.now(); + LocalDateTime firstMatchOriginal = TLWMatchesManagerBase.getFirstMatchtimeTLW(tlwMatchesOriginalMatchday); + LocalDateTime firstMatchUpdated = TLWMatchesManagerBase.getFirstMatchtimeAPIFootball(apiFootballMatches); + + if(apiFootballMatches.size() > 0 + && now.isBefore(firstMatchOriginal) + && now.isBefore(firstMatchUpdated)) { + addMissingMatches(tlwMatchesUpdatedMatchday, apiFootballMatches); + updateMatchDateTimes(tlwMatchesUpdatedMatchday, apiFootballMatches); + updateShowTable(tlwMatchesUpdatedMatchday, apiFootballMatches); + updateStatus(tlwMatchesUpdatedMatchday); + } this.tlwMatchesOriginal.addAll(tlwMatchesOriginalMatchday); this.tlwMatchesUpdated.addAll(tlwMatchesUpdatedMatchday); diff --git a/tokens/StoredCredential b/tokens/StoredCredential index c5c7e15..99ee11e 100644 Binary files a/tokens/StoredCredential and b/tokens/StoredCredential differ