Add support for Austria Bundesliga

This commit is contained in:
Julian Arndt
2025-10-27 17:24:54 +01:00
parent dc1ebb2b57
commit 476051409e
7 changed files with 20 additions and 10 deletions

View File

@@ -66,7 +66,7 @@ public class App {
apiFootballUpdater.updateAllRounds(season);
}
case "MatchesListGistUpdater" -> {
MatchesListForumUpdater matchesListForumUpdater = new MatchesListForumUpdater(season);
MatchesListForumUpdater matchesListForumUpdater = new MatchesListForumUpdater();
matchesListForumUpdater.updateAllLeagues(season);
}
case "PostChecksum" -> {

View File

@@ -50,7 +50,7 @@ public class APIFootballUpdater {
}
public void updateAllFixtures(int season) {
HashSet<Integer> leagues = getLeagues(season);
HashSet<Integer> leagues = getLeagues();
for (Integer league : leagues) {
updateFixtures(season, league);
try {
@@ -62,7 +62,7 @@ public class APIFootballUpdater {
}
public void updateAllRounds(int season) {
HashSet<Integer> leagues = getLeagues(season);
HashSet<Integer> leagues = getLeagues();
for (Integer league : leagues) {
updateRounds(season, league);
try {
@@ -125,7 +125,7 @@ public class APIFootballUpdater {
return result.toString();
}
public HashSet<Integer> getLeagues(int season) {
public HashSet<Integer> getLeagues() {
JSONArray leaguesArray = ResourceProvider.getLigenConfig();
HashSet<Integer> leagues = new HashSet<>();
for (Object leagueObject : leaguesArray) {

View File

@@ -13,8 +13,8 @@ public class MatchesListForumUpdater {
private HashSet<Integer> leagues;
private static final Logger logger = LoggerFactory.getLogger(MatchesListForumUpdater.class);
public MatchesListForumUpdater(int season) {
this.leagues = new APIFootballUpdater().getLeagues(season);
public MatchesListForumUpdater() {
this.leagues = new APIFootballUpdater().getLeagues();
}
public void updateAllLeagues(int season) {

View File

@@ -74,6 +74,11 @@
"name": "Eredivisie",
"league_id": 88
},
{
"country": "Austria",
"name": "Bundesliga",
"league_id": 218
},
{
"country": "World",
"name": "UEFA Champions League",

View File

@@ -1318,5 +1318,10 @@
"teamname": "RSV Eintracht",
"tippligaID": 659,
"apiFootballID": 14754
},
{
"teamname": "Sturm Graz",
"tippligaID": 559,
"apiFootballID": 637
}
]

View File

@@ -21,7 +21,7 @@ public class APIFootballUpdaterTest {
@Test
public void updateFixturesTest() {
APIFootballUpdater updater = new APIFootballUpdater();
updater.updateFixtures(season, 79);
updater.updateFixtures(season, 218);
}
@Test

View File

@@ -6,13 +6,13 @@ public class MatchesListForumUpdaterTest {
@Test
public void updateAllLeaguesTest() {
MatchesListForumUpdater updater = new MatchesListForumUpdater(2026);
MatchesListForumUpdater updater = new MatchesListForumUpdater();
updater.updateAllLeagues(2026);
}
@Test
public void updateLeagueTest() {
MatchesListForumUpdater updater = new MatchesListForumUpdater(2022);
updater.updateLeague(2022, 3509);
MatchesListForumUpdater updater = new MatchesListForumUpdater();
updater.updateLeague(2026, 218);
}
}