mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 16:52:55 +08:00
Merge pull request #15959 from bdach/fix-skins-resetting
Fix skin setting resetting every launch
This commit is contained in:
commit
8dc76964a3
@ -35,6 +35,16 @@ namespace osu.Game.Database
|
||||
|
||||
private void migrateSkins(DatabaseWriteUsage db)
|
||||
{
|
||||
// can be removed 20220530.
|
||||
var existingSkins = db.Context.SkinInfo
|
||||
.Include(s => s.Files)
|
||||
.ThenInclude(f => f.FileInfo)
|
||||
.ToList();
|
||||
|
||||
// previous entries in EF are removed post migration.
|
||||
if (!existingSkins.Any())
|
||||
return;
|
||||
|
||||
var userSkinChoice = config.GetBindable<string>(OsuSetting.Skin);
|
||||
int.TryParse(userSkinChoice.Value, out int userSkinInt);
|
||||
|
||||
@ -49,16 +59,6 @@ namespace osu.Game.Database
|
||||
break;
|
||||
}
|
||||
|
||||
// migrate ruleset settings. can be removed 20220530.
|
||||
var existingSkins = db.Context.SkinInfo
|
||||
.Include(s => s.Files)
|
||||
.ThenInclude(f => f.FileInfo)
|
||||
.ToList();
|
||||
|
||||
// previous entries in EF are removed post migration.
|
||||
if (!existingSkins.Any())
|
||||
return;
|
||||
|
||||
using (var realm = realmContextFactory.CreateContext())
|
||||
using (var transaction = realm.BeginWrite())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user