Fix beatmaps not getting the correct ruleset on import.

This commit is contained in:
Dean Herbert 2017-04-18 09:47:29 +09:00
parent 2734983564
commit d3c1520a2d
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
1 changed files with 2 additions and 3 deletions

View File

@ -219,10 +219,9 @@ private BeatmapSetInfo getBeatmapSet(string path)
beatmap.BeatmapInfo.Metadata = null;
// TODO: this should be done in a better place once we actually need to dynamically update it.
beatmap.BeatmapInfo.Ruleset = rulesets.Query<RulesetInfo>().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID);
beatmap.BeatmapInfo.StarDifficulty = rulesets.Query<RulesetInfo>().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID)?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0;
beatmap.BeatmapInfo.Ruleset = null;
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
}
beatmapSet.StoryboardFile = archive.StoryboardFilename;
@ -239,7 +238,7 @@ public void Import(IEnumerable<BeatmapSetInfo> beatmapSets)
foreach (var s in beatmapSets)
{
Connection.InsertWithChildren(s, true);
Connection.InsertOrReplaceWithChildren(s, true);
BeatmapSetAdded?.Invoke(s);
}