From d3c1520a2d4f851d394b81f49613a25369cbcc53 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 09:47:29 +0900 Subject: [PATCH] Fix beatmaps not getting the correct ruleset on import. --- osu.Game/Database/BeatmapDatabase.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index 7789096067..e11ea797ca 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -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().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID); beatmap.BeatmapInfo.StarDifficulty = rulesets.Query().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 beatmapSets) foreach (var s in beatmapSets) { - Connection.InsertWithChildren(s, true); + Connection.InsertOrReplaceWithChildren(s, true); BeatmapSetAdded?.Invoke(s); }