Add teams for wtl pokal

This commit is contained in:
2023-08-06 18:51:12 +02:00
parent fbca245326
commit cbc4b4ff76
3 changed files with 80 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ public abstract class TLWMatchesCreatorBase {
// Add matches from config
for(TLWMatch match : tlwMatches) {
sql += match.getSQLQueryInsert() + "\n";
sql += match.getSQLQueryReplace() + "\n";
}
return sql;

View File

@@ -1,12 +1,16 @@
package de.jeyp91.tippliga;
import de.jeyp91.tippligaforum.TippligaSQLConnector;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.Set;
public class TLWTeamsCreator {
private static final Logger logger = LogManager.getLogger(TLWTeamsCreator.class);
int season;
int league;
ArrayList<TLWMatch> matches;
@@ -36,6 +40,10 @@ public class TLWTeamsCreator {
String sql = "";
for (Integer id : teamIds) {
ArrayList<TLWTeam> teams = connector.getTeams(String.valueOf(id));
if(teams.size() == 0) {
this.logger.error("Did not find team id " + id.toString());
continue;
}
String teamName = teams.get(0).getTeamName();
String teamNameShort = teams.get(0).getTeamNameShort();
String teamSymbol = teams.get(0).getTeamSymbol();