mirror of https://github.com/ppy/osu
Fix beatmaps not getting the correct ruleset on import.
This commit is contained in:
parent
2734983564
commit
d3c1520a2d
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue