1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 16:47:46 +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:
Bartłomiej Dach 2024-02-14 18:07:59 +01:00 committed by GitHub
commit c588b81cee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 0 deletions

View File

@ -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()
{
var player = playToCompletion();

View File

@ -630,6 +630,12 @@ namespace osu.Game
var detachedSet = databasedSet.PerformRead(s => s.Detach());
if (detachedSet.DeletePending)
{
Logger.Log("The requested beatmap has since been deleted.", LoggingTarget.Information);
return;
}
PerformFromScreen(screen =>
{
// Find beatmaps that match our predicate.