Detach and reattach scores to make work

This commit is contained in:
Dean Herbert
2022-01-07 17:27:48 +09:00
parent 60d2de8a3b
commit 2b8706b6ce
7 changed files with 35 additions and 11 deletions

View File

@ -55,6 +55,15 @@ namespace osu.Game.Scoring
public Score GetScore(ScoreInfo score) => new LegacyDatabasedScore(score, rulesets, beatmaps(), Files.Store);
protected override Task Populate(ScoreInfo model, ArchiveReader? archive, Realm realm, CancellationToken cancellationToken = default)
=> Task.CompletedTask;
{
// Ensure the beatmap is not detached.
if (!model.Beatmap.IsManaged)
model.Beatmap = realm.Find<BeatmapInfo>(model.Beatmap.ID);
if (!model.Ruleset.IsManaged)
model.Ruleset = realm.Find<RulesetInfo>(model.Ruleset.ShortName);
return Task.CompletedTask;
}
}
}