mirror of
https://github.com/ppy/osu.git
synced 2024-11-12 07:47:27 +08:00
Merge pull request #1070 from peppy/transaction-on-import
Use a transaction when adding a beatmap
This commit is contained in:
commit
b2119efddf
@ -88,8 +88,12 @@ namespace osu.Game.Beatmaps
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="beatmapSet">The beatmap to add.</param>
|
/// <param name="beatmapSet">The beatmap to add.</param>
|
||||||
public void Add(BeatmapSetInfo beatmapSet)
|
public void Add(BeatmapSetInfo beatmapSet)
|
||||||
|
{
|
||||||
|
Connection.RunInTransaction(() =>
|
||||||
{
|
{
|
||||||
Connection.InsertOrReplaceWithChildren(beatmapSet, true);
|
Connection.InsertOrReplaceWithChildren(beatmapSet, true);
|
||||||
|
});
|
||||||
|
|
||||||
BeatmapSetAdded?.Invoke(beatmapSet);
|
BeatmapSetAdded?.Invoke(beatmapSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user