Fix realm error. Apply OriginalBeatmapHash on import

This commit is contained in:
Cootz 2023-02-06 13:58:41 +03:00
parent d23e787bc1
commit b00848e742
2 changed files with 1 additions and 6 deletions

View File

@ -456,12 +456,6 @@ namespace osu.Game.Beatmaps
if (transferCollections)
beatmapInfo.TransferCollectionReferences(r, oldMd5Hash);
//Unlinking all scores from this beatmap
r.All<ScoreInfo>().Where(s => s.BeatmapInfoID == beatmapInfo.ID).ForEach(s => s.BeatmapInfo = new BeatmapInfo());
//Linking all the previos scores
r.All<ScoreInfo>().Where(s => s.OriginalBeatmapHash == beatmapInfo.Hash).ForEach(s => s.BeatmapInfo = beatmapInfo);
ProcessBeatmap?.Invoke((liveBeatmapSet, false));
});
}

View File

@ -123,6 +123,7 @@ namespace osu.Game.Scoring.Legacy
// before returning for database import, we must restore the database-sourced BeatmapInfo.
// if not, the clone operation in GetPlayableBeatmap will cause a dereference and subsequent database exception.
score.ScoreInfo.BeatmapInfo = workingBeatmap.BeatmapInfo;
score.ScoreInfo.OriginalBeatmapHash = workingBeatmap.BeatmapInfo.Hash;
return score;
}