From 6661195e924642d70ca9bf4cae144917aabd3eb8 Mon Sep 17 00:00:00 2001 From: Mikal Stodal Date: Thu, 2 Mar 2017 13:36:01 +0100 Subject: [PATCH] Only add set if ID is 0 --- osu.Game/Database/BeatmapDatabase.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index 13f76b9837..ad4ce06588 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -125,7 +125,8 @@ namespace osu.Game.Database { BeatmapSetInfo set = getBeatmapSet(p); - sets.Push(set); + if (set.ID == 0) + sets.Push(set); // We may or may not want to delete the file depending on where it is stored. // e.g. reconstructing/repairing database with beatmaps from default storage. @@ -193,7 +194,7 @@ namespace osu.Game.Database BeatmapSetAdded?.Invoke(existing); } - return null; + return existing; } var beatmapSet = new BeatmapSetInfo @@ -233,11 +234,10 @@ namespace osu.Game.Database connection.BeginTransaction(); foreach (var s in beatmapSets) - if (s != null) - { - connection.InsertWithChildren(s, true); - BeatmapSetAdded?.Invoke(s); - } + { + connection.InsertWithChildren(s, true); + BeatmapSetAdded?.Invoke(s); + } connection.Commit(); }