From 25aebdf42d357bcb97c92167bdc3aeb1e0d00fec Mon Sep 17 00:00:00 2001 From: Software Magico Date: Fri, 14 Jun 2024 10:20:31 +0200 Subject: [PATCH] Refrshing shiaijos correctly when changing the number of winners. --- .../softwaremagico/kt/core/providers/TournamentProvider.java | 3 --- .../kt/core/tournaments/TreeTournamentHandler.java | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/providers/TournamentProvider.java b/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/providers/TournamentProvider.java index 39719d074..5a9355192 100644 --- a/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/providers/TournamentProvider.java +++ b/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/providers/TournamentProvider.java @@ -215,9 +215,6 @@ public void setNumberOfWinners(Integer tournamentId, Integer numberOfWinners, St //Resize tournament ((TreeTournamentHandler) tournamentManager).recreateGroupSize(tournament, numberOfWinners); KendoTournamentLogger.info(this.getClass(), "Updated tournament '{}' with number of winners '{}' by '{}'", tournament, numberOfWinners, updatedBy); - - //Update the shiaijo numbers. - ((TreeTournamentHandler) tournamentManager).adjustGroupsShiaijos(tournament); } else { KendoTournamentLogger.warning(this.getClass(), "Cannot change the number of winners as tournament is of type '{}'.", tournament.getType()); } diff --git a/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/tournaments/TreeTournamentHandler.java b/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/tournaments/TreeTournamentHandler.java index 705758400..7a059f04b 100644 --- a/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/tournaments/TreeTournamentHandler.java +++ b/backend/kendo-tournament-core/src/main/java/com/softwaremagico/kt/core/tournaments/TreeTournamentHandler.java @@ -128,6 +128,8 @@ public Group addGroup(Tournament tournament, Group group) { public void recreateGroupSize(Tournament tournament, int numberOfWinners) { groupProvider.delete(tournament, 1); adjustGroupsSize(tournament, numberOfWinners); + //Update the shiaijo numbers. + adjustGroupsShiaijos(tournament); } public void adjustGroupsSize(Tournament tournament, int numberOfWinners) {