Add support for Austria Bundesliga
This commit is contained in:
@@ -66,7 +66,7 @@ public class App {
|
|||||||
apiFootballUpdater.updateAllRounds(season);
|
apiFootballUpdater.updateAllRounds(season);
|
||||||
}
|
}
|
||||||
case "MatchesListGistUpdater" -> {
|
case "MatchesListGistUpdater" -> {
|
||||||
MatchesListForumUpdater matchesListForumUpdater = new MatchesListForumUpdater(season);
|
MatchesListForumUpdater matchesListForumUpdater = new MatchesListForumUpdater();
|
||||||
matchesListForumUpdater.updateAllLeagues(season);
|
matchesListForumUpdater.updateAllLeagues(season);
|
||||||
}
|
}
|
||||||
case "PostChecksum" -> {
|
case "PostChecksum" -> {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class APIFootballUpdater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateAllFixtures(int season) {
|
public void updateAllFixtures(int season) {
|
||||||
HashSet<Integer> leagues = getLeagues(season);
|
HashSet<Integer> leagues = getLeagues();
|
||||||
for (Integer league : leagues) {
|
for (Integer league : leagues) {
|
||||||
updateFixtures(season, league);
|
updateFixtures(season, league);
|
||||||
try {
|
try {
|
||||||
@@ -62,7 +62,7 @@ public class APIFootballUpdater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateAllRounds(int season) {
|
public void updateAllRounds(int season) {
|
||||||
HashSet<Integer> leagues = getLeagues(season);
|
HashSet<Integer> leagues = getLeagues();
|
||||||
for (Integer league : leagues) {
|
for (Integer league : leagues) {
|
||||||
updateRounds(season, league);
|
updateRounds(season, league);
|
||||||
try {
|
try {
|
||||||
@@ -125,7 +125,7 @@ public class APIFootballUpdater {
|
|||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashSet<Integer> getLeagues(int season) {
|
public HashSet<Integer> getLeagues() {
|
||||||
JSONArray leaguesArray = ResourceProvider.getLigenConfig();
|
JSONArray leaguesArray = ResourceProvider.getLigenConfig();
|
||||||
HashSet<Integer> leagues = new HashSet<>();
|
HashSet<Integer> leagues = new HashSet<>();
|
||||||
for (Object leagueObject : leaguesArray) {
|
for (Object leagueObject : leaguesArray) {
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ public class MatchesListForumUpdater {
|
|||||||
private HashSet<Integer> leagues;
|
private HashSet<Integer> leagues;
|
||||||
private static final Logger logger = LoggerFactory.getLogger(MatchesListForumUpdater.class);
|
private static final Logger logger = LoggerFactory.getLogger(MatchesListForumUpdater.class);
|
||||||
|
|
||||||
public MatchesListForumUpdater(int season) {
|
public MatchesListForumUpdater() {
|
||||||
this.leagues = new APIFootballUpdater().getLeagues(season);
|
this.leagues = new APIFootballUpdater().getLeagues();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateAllLeagues(int season) {
|
public void updateAllLeagues(int season) {
|
||||||
|
|||||||
@@ -74,6 +74,11 @@
|
|||||||
"name": "Eredivisie",
|
"name": "Eredivisie",
|
||||||
"league_id": 88
|
"league_id": 88
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"country": "Austria",
|
||||||
|
"name": "Bundesliga",
|
||||||
|
"league_id": 218
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"country": "World",
|
"country": "World",
|
||||||
"name": "UEFA Champions League",
|
"name": "UEFA Champions League",
|
||||||
|
|||||||
@@ -1318,5 +1318,10 @@
|
|||||||
"teamname": "RSV Eintracht",
|
"teamname": "RSV Eintracht",
|
||||||
"tippligaID": 659,
|
"tippligaID": 659,
|
||||||
"apiFootballID": 14754
|
"apiFootballID": 14754
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "Sturm Graz",
|
||||||
|
"tippligaID": 559,
|
||||||
|
"apiFootballID": 637
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class APIFootballUpdaterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void updateFixturesTest() {
|
public void updateFixturesTest() {
|
||||||
APIFootballUpdater updater = new APIFootballUpdater();
|
APIFootballUpdater updater = new APIFootballUpdater();
|
||||||
updater.updateFixtures(season, 79);
|
updater.updateFixtures(season, 218);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ public class MatchesListForumUpdaterTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void updateAllLeaguesTest() {
|
public void updateAllLeaguesTest() {
|
||||||
MatchesListForumUpdater updater = new MatchesListForumUpdater(2026);
|
MatchesListForumUpdater updater = new MatchesListForumUpdater();
|
||||||
updater.updateAllLeagues(2026);
|
updater.updateAllLeagues(2026);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void updateLeagueTest() {
|
public void updateLeagueTest() {
|
||||||
MatchesListForumUpdater updater = new MatchesListForumUpdater(2022);
|
MatchesListForumUpdater updater = new MatchesListForumUpdater();
|
||||||
updater.updateLeague(2022, 3509);
|
updater.updateLeague(2026, 218);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user