1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 10:42:55 +08:00

Only add set if ID is 0

This commit is contained in:
Mikal Stodal 2017-03-02 13:36:01 +01:00
parent 418ae24fea
commit 6661195e92

View File

@ -125,7 +125,8 @@ namespace osu.Game.Database
{ {
BeatmapSetInfo set = getBeatmapSet(p); 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. // 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. // e.g. reconstructing/repairing database with beatmaps from default storage.
@ -193,7 +194,7 @@ namespace osu.Game.Database
BeatmapSetAdded?.Invoke(existing); BeatmapSetAdded?.Invoke(existing);
} }
return null; return existing;
} }
var beatmapSet = new BeatmapSetInfo var beatmapSet = new BeatmapSetInfo
@ -233,11 +234,10 @@ namespace osu.Game.Database
connection.BeginTransaction(); connection.BeginTransaction();
foreach (var s in beatmapSets) foreach (var s in beatmapSets)
if (s != null) {
{ connection.InsertWithChildren(s, true);
connection.InsertWithChildren(s, true); BeatmapSetAdded?.Invoke(s);
BeatmapSetAdded?.Invoke(s); }
}
connection.Commit(); connection.Commit();
} }