Small fixes for formula matching

This commit is contained in:
2026-08-03 10:09:38 +02:00
parent 2055c15906
commit c8ec6f1846
5 changed files with 21 additions and 17 deletions
+1
View File
@@ -6,4 +6,5 @@
},
"java.debug.settings.onBuildFailureProceed": true,
"jdk.jdkhome": "/Users/julian/.local/share/mise/installs/java/22.0.2",
"java.debug.settings.console": "internalConsole"
}
+4 -12
View File
@@ -179,19 +179,11 @@ public class TLWMatch extends BaseMatch{
}
public String getFormulaHome() {
String formula = "D";
if (this.formulaHome != null) {
formula = this.formulaHome;
}
return "'" + formula + "'";
return this.formulaHome != null ? this.formulaHome : "D";
}
public String getFormulaGuest() {
String formula = "D";
if (this.formulaGuest != null) {
formula = this.formulaGuest;
}
return "'" + formula + "'";
return this.formulaGuest != null ? this.formulaGuest : "D";
}
public String getSQLQueryInsert() {
@@ -218,8 +210,8 @@ public class TLWMatch extends BaseMatch{
this.status + ", " +
nullToSqlEmptyString(this.matchDatetime) + ", " +
nullToSqlEmptyString(this.groupId) + ", " +
getFormulaHome() + ", " +
getFormulaGuest() + ", " +
"'" + getFormulaHome() + "'" + ", " +
"'" + getFormulaGuest() + "'" + ", " +
nullToSqlEmptyString(this.koMatch) + ", " +
nullToSqlEmptyString(this.goalsOvertimeHome) + ", " +
nullToSqlEmptyString(this.goalsOvertimeGuest) + ", " +
@@ -193,9 +193,15 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
// update empty match
if(!done) {
for (TLWMatch tlwMatch : tlwMatches) {
if (tlwMatch.getTeamIdHome() == 0 && tlwMatch.getTeamIdGuest() == 0
&& (Objects.equals(tlwMatch.getFormulaHome(), "") || Objects.equals(tlwMatch.getFormulaHome(), "D"))
&& (Objects.equals(tlwMatch.getFormulaGuest(), "") || Objects.equals(tlwMatch.getFormulaGuest(), "D"))
Integer teamIdHome = tlwMatch.getTeamIdHome();
Integer teamIdGuest = tlwMatch.getTeamIdGuest();
String formulaHome = tlwMatch.getFormulaHome();
String formulaGuest = tlwMatch.getFormulaGuest();
if (
(Objects.equals(teamIdHome, 0) || Objects.equals(teamIdHome, null))
&& (Objects.equals(teamIdGuest, 0) || Objects.equals(teamIdGuest, null))
&& (Objects.equals(formulaHome, "") || Objects.equals(formulaHome, "D"))
&& (Objects.equals(formulaGuest, "") || Objects.equals(formulaGuest, "D"))
) {
tlwMatch.updateMatch(missingMatch);
done = true;
@@ -1564,6 +1564,11 @@
"tippligaID": 677,
"apiFootballID": 16078
},
{
"teamname": "Fortuna Köln",
"tippligaID": 583,
"apiFootballID": 1326
},
{
"teamname": "NEXT TEAM",
"tippligaID": 674,
@@ -121,14 +121,14 @@
{
"type": "PlaceholderSingleMatch",
"koMatch": true,
"placeholderDatetime": "2027-04-20 20:45:00",
"placeholderDatetime": "2027-04-21 20:45:00",
"formulaHome": "D",
"formulaGuest": "D"
},
{
"type": "PlaceholderSingleMatch",
"koMatch": true,
"placeholderDatetime": "2027-04-20 20:45:00",
"placeholderDatetime": "2027-04-21 20:45:00",
"formulaHome": "D",
"formulaGuest": "D"
},