Move difficulty copy inside context retrieval

This commit is contained in:
Dean Herbert 2021-10-07 17:49:13 +09:00
parent d3efec3c04
commit ee66414e4f

View File

@ -192,8 +192,6 @@ namespace osu.Game.Beatmaps
{
var setInfo = beatmapInfo.BeatmapSet;
beatmapInfo.BaseDifficulty.CopyFrom(beatmapContent.Difficulty);
using (var stream = new MemoryStream())
{
using (var sw = new StreamWriter(stream, Encoding.UTF8, 1024, true))
@ -204,6 +202,8 @@ namespace osu.Game.Beatmaps
using (ContextFactory.GetForWrite())
{
beatmapInfo = setInfo.Beatmaps.Single(b => b.ID == beatmapInfo.ID);
beatmapInfo.BaseDifficulty.CopyFrom(beatmapContent.Difficulty);
var metadata = beatmapInfo.Metadata ?? setInfo.Metadata;
// grab the original file (or create a new one if not found).