fix update month data rank issue

newoffer2025
Razmig Sarkissian 5 months ago
parent 4560ebb30a
commit 6d7c6d35b2
  1. 13
      PadelClub.xcodeproj/project.pbxproj
  2. 14
      PadelClub/Extensions/Tournament+Extensions.swift
  3. 2
      PadelClub/Views/GroupStage/Components/GroupStageSettingsView.swift
  4. 2
      PadelClub/Views/Tournament/Screen/Components/UpdateSourceRankDateView.swift

@ -3099,6 +3099,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
DEVELOPMENT_TEAM = BQ3Y44M3Q6;
ENABLE_DEBUG_DYLIB = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = PadelClub/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Padel Club";
@ -3120,7 +3121,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.32;
MARKETING_VERSION = 1.2.33;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -3166,7 +3167,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.32;
MARKETING_VERSION = 1.2.33;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -3285,7 +3286,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.32;
MARKETING_VERSION = 1.2.33;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -3330,7 +3331,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.32;
MARKETING_VERSION = 1.2.33;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -3374,7 +3375,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.32;
MARKETING_VERSION = 1.2.33;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub.beta;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -3416,7 +3417,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.32;
MARKETING_VERSION = 1.2.33;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub.beta;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

@ -277,13 +277,7 @@ extension Tournament {
newMonthData.maleUnrankedValue = await lastRankMan
newMonthData.femaleUnrankedValue = await lastRankWoman
do {
try DataStore.shared.monthData.addOrUpdate(instance: newMonthData)
} catch {
Logger.error(error)
}
DataStore.shared.monthData.addOrUpdate(instance: newMonthData)
monthData = newMonthData
}
@ -303,7 +297,7 @@ extension Tournament {
}
let players = unsortedPlayers()
try await players.concurrentForEach { player in
for player in players {
let lastRank = (player.sex == .female) ? lastRankWoman : lastRankMan
try await player.updateRank(from: chunkedParsers, lastRank: lastRank)
player.setComputedRank(in: self)
@ -315,7 +309,7 @@ extension Tournament {
}
}
try tournamentStore?.playerRegistrations.addOrUpdate(contentOfs: players)
tournamentStore?.playerRegistrations.addOrUpdate(contentOfs: players)
let unsortedTeams = unsortedTeams()
unsortedTeams.forEach { team in
@ -324,7 +318,7 @@ extension Tournament {
team.lockedWeight = team.weight
}
}
try tournamentStore?.teamRegistrations.addOrUpdate(contentOfs: unsortedTeams)
tournamentStore?.teamRegistrations.addOrUpdate(contentOfs: unsortedTeams)
refreshRanking = false
}

@ -179,7 +179,7 @@ struct GroupStageSettingsView: View {
}
Section {
RowButtonView("Rafraichir", role: .destructive) {
RowButtonView("Rafraîchir", role: .destructive) {
let playedMatches = groupStage.playedMatches()
playedMatches.forEach { match in
match.updateTeamScores()

@ -45,7 +45,7 @@ struct UpdateSourceRankDateView: View {
do {
try await tournament.updateRank(to: currentRankSourceDate, forceRefreshLockWeight: forceRefreshLockWeight, providedSources: nil)
try dataStore.tournaments.addOrUpdate(instance: tournament)
dataStore.tournaments.addOrUpdate(instance: tournament)
} catch {
Logger.error(error)
}

Loading…
Cancel
Save