1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 01:43:15 +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);
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();
}