mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 08:02:55 +08:00
Merge pull request #27163 from frenzibyte/ignore-soft-deleted-beatmaps-in-notification
Ignore soft-deleted beatmaps when trying to present from notification
This commit is contained in:
commit
c588b81cee
@ -986,6 +986,29 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestPresentBeatmapAfterDeletion()
|
||||||
|
{
|
||||||
|
BeatmapSetInfo beatmap = null;
|
||||||
|
|
||||||
|
Screens.Select.SongSelect songSelect = null;
|
||||||
|
PushAndConfirm(() => songSelect = new TestPlaySongSelect());
|
||||||
|
AddUntilStep("wait for song select", () => songSelect.BeatmapSetsLoaded);
|
||||||
|
|
||||||
|
AddStep("import beatmap", () => BeatmapImportHelper.LoadQuickOszIntoOsu(Game).WaitSafely());
|
||||||
|
AddUntilStep("wait for selected", () => !Game.Beatmap.IsDefault);
|
||||||
|
|
||||||
|
AddStep("delete selected beatmap", () =>
|
||||||
|
{
|
||||||
|
beatmap = Game.Beatmap.Value.BeatmapSetInfo;
|
||||||
|
Game.BeatmapManager.Delete(Game.Beatmap.Value.BeatmapSetInfo);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("nothing selected", () => Game.Beatmap.IsDefault);
|
||||||
|
AddStep("present deleted beatmap", () => Game.PresentBeatmap(beatmap));
|
||||||
|
AddAssert("still nothing selected", () => Game.Beatmap.IsDefault);
|
||||||
|
}
|
||||||
|
|
||||||
private Func<Player> playToResults()
|
private Func<Player> playToResults()
|
||||||
{
|
{
|
||||||
var player = playToCompletion();
|
var player = playToCompletion();
|
||||||
|
@ -630,6 +630,12 @@ namespace osu.Game
|
|||||||
|
|
||||||
var detachedSet = databasedSet.PerformRead(s => s.Detach());
|
var detachedSet = databasedSet.PerformRead(s => s.Detach());
|
||||||
|
|
||||||
|
if (detachedSet.DeletePending)
|
||||||
|
{
|
||||||
|
Logger.Log("The requested beatmap has since been deleted.", LoggingTarget.Information);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PerformFromScreen(screen =>
|
PerformFromScreen(screen =>
|
||||||
{
|
{
|
||||||
// Find beatmaps that match our predicate.
|
// Find beatmaps that match our predicate.
|
||||||
|
Loading…
Reference in New Issue
Block a user