From 78767cec869d530e31560e7c4c74f2a74168eb25 Mon Sep 17 00:00:00 2001 From: Raz Date: Sun, 4 May 2025 20:20:32 +0200 Subject: [PATCH 1/2] fix issue with event --- PadelClubData/Data/Event.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PadelClubData/Data/Event.swift b/PadelClubData/Data/Event.swift index 210c5f7..57db29a 100644 --- a/PadelClubData/Data/Event.swift +++ b/PadelClubData/Data/Event.swift @@ -87,6 +87,14 @@ final public class Event: BaseEvent { }) } + public func federalTournaments() -> [Tournament] { + tournaments.filter({ $0.isAnimation() == false && $0.isCanceled == false && $0.isDeleted == false }) + } + + public func paidTournaments() -> [Tournament] { + tournaments.filter({ $0.isFree() == false && $0.isCanceled == false && $0.isDeleted == false }) + } + func insertOnServer() throws { DataStore.shared.events.writeChangeAndInsertOnServer(instance: self) for tournament in self.tournaments { From 27168afb34b9a138364fc96e3aa42b1688fe8f07 Mon Sep 17 00:00:00 2001 From: Raz Date: Sun, 4 May 2025 20:37:38 +0200 Subject: [PATCH 2/2] fix crash with groupstage more than 6 teams --- PadelClubData/Data/GroupStage.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PadelClubData/Data/GroupStage.swift b/PadelClubData/Data/GroupStage.swift index 67f7d18..a067168 100644 --- a/PadelClubData/Data/GroupStage.swift +++ b/PadelClubData/Data/GroupStage.swift @@ -166,7 +166,7 @@ final public class GroupStage: BaseGroupStage, SideStorable { let order = _matchOrder() let matchCount = max(1, matchCount) let count = ordered.count / matchCount - if ordered.isEmpty == false && ordered.count % order.count == 0 { + if ordered.isEmpty == false && order.isEmpty == false && ordered.count % order.count == 0 { let repeatedArray = (0..