Do not reprocess ranks for custom rulesets

Chances are that because we've broken rank API, it would utterly fail
for all custom rulesets anyhow.
This commit is contained in:
Bartłomiej Dach 2024-01-23 12:59:35 +01:00
parent 0b5be3c40c
commit 6c169e3156
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -383,7 +383,10 @@ private void upgradeScoreRanks()
HashSet<Guid> scoreIds = realmAccess.Run(r => new HashSet<Guid>(
r.All<ScoreInfo>()
.Where(s => s.TotalScoreVersion < LegacyScoreEncoder.LATEST_VERSION)
.AsEnumerable() // need to materialise here as realm cannot support `.Select()`.
.AsEnumerable()
// must be done after materialisation, as realm doesn't support
// filtering on nested property predicates or projection via `.Select()`
.Where(s => s.Ruleset.IsLegacyRuleset())
.Select(s => s.ID)));
Logger.Log($"Found {scoreIds.Count} scores which require rank upgrades.");