Laurent 6 months ago
commit bbf1bd8c65
  1. 8
      PadelClubData/Data/Event.swift
  2. 2
      PadelClubData/Data/GroupStage.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 {

@ -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..<count).flatMap { i in
order.map { $0 + i * order.count }
}

Loading…
Cancel
Save