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, "java.debug.settings.onBuildFailureProceed": true,
"jdk.jdkhome": "/Users/julian/.local/share/mise/installs/java/22.0.2", "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() { public String getFormulaHome() {
String formula = "D"; return this.formulaHome != null ? this.formulaHome : "D";
if (this.formulaHome != null) {
formula = this.formulaHome;
}
return "'" + formula + "'";
} }
public String getFormulaGuest() { public String getFormulaGuest() {
String formula = "D"; return this.formulaGuest != null ? this.formulaGuest : "D";
if (this.formulaGuest != null) {
formula = this.formulaGuest;
}
return "'" + formula + "'";
} }
public String getSQLQueryInsert() { public String getSQLQueryInsert() {
@@ -218,8 +210,8 @@ public class TLWMatch extends BaseMatch{
this.status + ", " + this.status + ", " +
nullToSqlEmptyString(this.matchDatetime) + ", " + nullToSqlEmptyString(this.matchDatetime) + ", " +
nullToSqlEmptyString(this.groupId) + ", " + nullToSqlEmptyString(this.groupId) + ", " +
getFormulaHome() + ", " + "'" + getFormulaHome() + "'" + ", " +
getFormulaGuest() + ", " + "'" + getFormulaGuest() + "'" + ", " +
nullToSqlEmptyString(this.koMatch) + ", " + nullToSqlEmptyString(this.koMatch) + ", " +
nullToSqlEmptyString(this.goalsOvertimeHome) + ", " + nullToSqlEmptyString(this.goalsOvertimeHome) + ", " +
nullToSqlEmptyString(this.goalsOvertimeGuest) + ", " + nullToSqlEmptyString(this.goalsOvertimeGuest) + ", " +
@@ -193,9 +193,15 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
// update empty match // update empty match
if(!done) { if(!done) {
for (TLWMatch tlwMatch : tlwMatches) { for (TLWMatch tlwMatch : tlwMatches) {
if (tlwMatch.getTeamIdHome() == 0 && tlwMatch.getTeamIdGuest() == 0 Integer teamIdHome = tlwMatch.getTeamIdHome();
&& (Objects.equals(tlwMatch.getFormulaHome(), "") || Objects.equals(tlwMatch.getFormulaHome(), "D")) Integer teamIdGuest = tlwMatch.getTeamIdGuest();
&& (Objects.equals(tlwMatch.getFormulaGuest(), "") || Objects.equals(tlwMatch.getFormulaGuest(), "D")) 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); tlwMatch.updateMatch(missingMatch);
done = true; done = true;
@@ -1564,6 +1564,11 @@
"tippligaID": 677, "tippligaID": 677,
"apiFootballID": 16078 "apiFootballID": 16078
}, },
{
"teamname": "Fortuna Köln",
"tippligaID": 583,
"apiFootballID": 1326
},
{ {
"teamname": "NEXT TEAM", "teamname": "NEXT TEAM",
"tippligaID": 674, "tippligaID": 674,
@@ -121,14 +121,14 @@
{ {
"type": "PlaceholderSingleMatch", "type": "PlaceholderSingleMatch",
"koMatch": true, "koMatch": true,
"placeholderDatetime": "2027-04-20 20:45:00", "placeholderDatetime": "2027-04-21 20:45:00",
"formulaHome": "D", "formulaHome": "D",
"formulaGuest": "D" "formulaGuest": "D"
}, },
{ {
"type": "PlaceholderSingleMatch", "type": "PlaceholderSingleMatch",
"koMatch": true, "koMatch": true,
"placeholderDatetime": "2027-04-20 20:45:00", "placeholderDatetime": "2027-04-21 20:45:00",
"formulaHome": "D", "formulaHome": "D",
"formulaGuest": "D" "formulaGuest": "D"
}, },