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
1 changed files with 2 additions and 2 deletions

View File

@ -192,8 +192,6 @@ public virtual void Save(BeatmapInfo beatmapInfo, IBeatmap beatmapContent, ISkin
{
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 @@ public virtual void Save(BeatmapInfo beatmapInfo, IBeatmap beatmapContent, ISkin
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).