mirror of
https://github.com/ppy/osu
synced 2024-12-29 02:12:43 +00:00
Make RealmArchiveModelManager.Update
work using automapper
This commit is contained in:
parent
7509a9ff8f
commit
80eee6d7b0
@ -123,11 +123,7 @@ namespace osu.Game.Screens.Menu
|
||||
// this could happen if a user has nuked their files store. for now, reimport to repair this.
|
||||
var import = beatmaps.Import(new ZipArchiveReader(game.Resources.GetStream($"Tracks/{BeatmapFile}"), BeatmapFile)).GetResultSafely();
|
||||
|
||||
import?.PerformWrite(b =>
|
||||
{
|
||||
b.Protected = true;
|
||||
beatmaps.Update(b);
|
||||
});
|
||||
import?.PerformWrite(b => b.Protected = true);
|
||||
|
||||
loadThemedIntro();
|
||||
}
|
||||
|
@ -202,8 +202,13 @@ namespace osu.Game.Stores
|
||||
|
||||
public abstract bool IsAvailableLocally(TModel model);
|
||||
|
||||
public void Update(TModel skin)
|
||||
public void Update(TModel model)
|
||||
{
|
||||
using (var realm = ContextFactory.CreateContext())
|
||||
{
|
||||
var existing = realm.Find<TModel>(model.ID);
|
||||
realm.Write(r => model.CopyChangesToRealm(existing));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user