diff --git a/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs index e7e196555f..98ccbf85fd 100644 --- a/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs @@ -108,7 +108,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance deleteSkinsButton.Enabled.Value = false; Task.Run(() => { - skins.Delete(s => !s.DeletePending); + skins.Delete(); }).ContinueWith(t => Schedule(() => deleteSkinsButton.Enabled.Value = true)); })); } diff --git a/osu.Game/Skinning/SkinManager.cs b/osu.Game/Skinning/SkinManager.cs index 5c07244e0f..d6c884d259 100644 --- a/osu.Game/Skinning/SkinManager.cs +++ b/osu.Game/Skinning/SkinManager.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Bindables; @@ -286,15 +287,18 @@ namespace osu.Game.Skinning { using (var context = contextFactory.CreateContext()) { - var items = context.All().Where(filter).ToList(); + var items = context.All() + .Where(s => !s.Protected && !s.DeletePending); + if (filter != null) + items = items.Where(filter); // check the removed skin is not the current user choice. if it is, switch back to default. Guid currentUserSkin = CurrentSkinInfo.Value.ID; if (items.Any(s => s.ID == currentUserSkin)) - scheduler.Add(() => CurrentSkinInfo.Value = SkinInfo.Default.ToLive()); + scheduler.Add(() => CurrentSkinInfo.Value = Skinning.DefaultSkin.CreateInfo().ToLive()); - skinModelManager.Delete(items, silent); + skinModelManager.Delete(items.ToList(), silent); } }