mirror of https://github.com/ppy/osu
Move difficulty copy inside context retrieval
This commit is contained in:
parent
d3efec3c04
commit
ee66414e4f
|
@ -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).
|
||||
|
|
Loading…
Reference in New Issue