Fix reprocessing not working on import due to realm threading woes

This commit is contained in:
Dean Herbert
2022-06-24 19:04:20 +09:00
parent 30b3973c9f
commit 0c3d890f76
2 changed files with 16 additions and 10 deletions

View File

@ -80,8 +80,6 @@ namespace osu.Game.Beatmaps
// If this is ever an issue, we can consider marking as pending delete but not resetting the IDs (but care will be required for
// beatmaps, which don't have their own `DeletePending` state).
beatmapUpdater?.Process(beatmapSet, realm);
if (beatmapSet.OnlineID > 0)
{
var existingSetWithSameOnlineID = realm.All<BeatmapSetInfo>().SingleOrDefault(b => b.OnlineID == beatmapSet.OnlineID);
@ -99,6 +97,13 @@ namespace osu.Game.Beatmaps
}
}
protected override void PostImport(BeatmapSetInfo model, Realm realm)
{
base.PostImport(model, realm);
beatmapUpdater?.Process(model);
}
private void validateOnlineIds(BeatmapSetInfo beatmapSet, Realm realm)
{
var beatmapIds = beatmapSet.Beatmaps.Where(b => b.OnlineID > 0).Select(b => b.OnlineID).ToList();