1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 17:52:56 +08:00

Skip importing scores which have no matching realm ruleset

There's no real way to recover these unless we want to start importing
rulesets into realm. And that seems counter productive. This can only
happen if users don't have the dll present any more, and it was removed
far before realm was tracking rulesets (else it would have an
`Available=0` entry in realm to match).
This commit is contained in:
Dean Herbert 2022-01-26 18:04:53 +09:00
parent f2d48d088d
commit 3aa681005b

View File

@ -286,6 +286,7 @@ namespace osu.Game.Database
var transaction = r.BeginWrite();
int written = 0;
int missing = 0;
try
{
@ -300,6 +301,13 @@ namespace osu.Game.Database
var beatmap = r.All<BeatmapInfo>().First(b => b.Hash == score.BeatmapInfo.Hash);
var ruleset = r.Find<RulesetInfo>(score.Ruleset.ShortName);
if (ruleset == null)
{
log($"Skipping {++missing} scores with missing ruleset");
continue;
}
var user = new RealmUser
{
OnlineID = score.User.OnlineID,