mirror of
https://github.com/ppy/osu
synced 2024-12-15 19:36:34 +00:00
Fix beatmap mass deletion flow
This commit is contained in:
parent
d5239d550a
commit
46206f70d6
@ -234,6 +234,19 @@ namespace osu.Game.Beatmaps
|
||||
beatmapModelManager.Delete(items, silent);
|
||||
}
|
||||
|
||||
public void Delete(Expression<Func<BeatmapSetInfo, bool>>? filter = null, bool silent = false)
|
||||
{
|
||||
using (var context = contextFactory.CreateContext())
|
||||
{
|
||||
var items = context.All<BeatmapSetInfo>().Where(s => !s.DeletePending);
|
||||
|
||||
if (filter != null)
|
||||
items = items.Where(filter);
|
||||
|
||||
beatmapModelManager.Delete(items.ToList(), silent);
|
||||
}
|
||||
}
|
||||
|
||||
public void Undelete(List<BeatmapSetInfo> items, bool silent = false)
|
||||
{
|
||||
beatmapModelManager.Undelete(items, silent);
|
||||
|
@ -54,7 +54,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
dialogOverlay?.Push(new MassDeleteConfirmationDialog(() =>
|
||||
{
|
||||
deleteBeatmapsButton.Enabled.Value = false;
|
||||
Task.Run(() => beatmaps.Delete(beatmaps.GetAllUsableBeatmapSets())).ContinueWith(t => Schedule(() => deleteBeatmapsButton.Enabled.Value = true));
|
||||
Task.Run(() => beatmaps.Delete()).ContinueWith(t => Schedule(() => deleteBeatmapsButton.Enabled.Value = true));
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user