mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Fix beatmap restore/undelete flows
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
@ -106,10 +105,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
dialogOverlay?.Push(new MassDeleteConfirmationDialog(() =>
|
||||
{
|
||||
deleteSkinsButton.Enabled.Value = false;
|
||||
Task.Run(() =>
|
||||
{
|
||||
skins.Delete();
|
||||
}).ContinueWith(t => Schedule(() => deleteSkinsButton.Enabled.Value = true));
|
||||
Task.Run(() => skins.Delete()).ContinueWith(t => Schedule(() => deleteSkinsButton.Enabled.Value = true));
|
||||
}));
|
||||
}
|
||||
});
|
||||
@ -147,11 +143,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
Action = () =>
|
||||
{
|
||||
restoreButton.Enabled.Value = false;
|
||||
Task.Run(() =>
|
||||
{
|
||||
foreach (var b in beatmaps.QueryBeatmaps(b => b.Hidden).ToList())
|
||||
beatmaps.Restore(b);
|
||||
}).ContinueWith(t => Schedule(() => restoreButton.Enabled.Value = true));
|
||||
Task.Run(beatmaps.RestoreAll).ContinueWith(t => Schedule(() => restoreButton.Enabled.Value = true));
|
||||
}
|
||||
},
|
||||
undeleteButton = new SettingsButton
|
||||
@ -160,8 +152,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
Action = () =>
|
||||
{
|
||||
undeleteButton.Enabled.Value = false;
|
||||
// TODO: reimplement similar to SkinManager?
|
||||
// Task.Run(() => beatmaps.Undelete(beatmaps.QueryBeatmapSets(b => b.DeletePending).ToList())).ContinueWith(t => Schedule(() => undeleteButton.Enabled.Value = true));
|
||||
Task.Run(beatmaps.UndeleteAll).ContinueWith(t => Schedule(() => undeleteButton.Enabled.Value = true));
|
||||
}
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user