1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Change conditional to check for insertions in addition to modifications

It is possible that the import process itself marks the previous
beatmaps as deleted due to an overlap in metadata or otherwise.
This commit is contained in:
Dean Herbert 2022-08-16 16:21:35 +09:00
parent c8fdfd298c
commit 9d2c2b71cf

View File

@ -273,11 +273,13 @@ namespace osu.Game.Screens.Select
// Check if the current selection was potentially deleted by re-querying its validity.
bool selectedSetMarkedDeleted = realm.Run(r => r.Find<BeatmapSetInfo>(SelectedBeatmapSet.ID))?.DeletePending != false;
if (selectedSetMarkedDeleted && changes.NewModifiedIndices.Any())
int[] modifiedAndInserted = changes.NewModifiedIndices.Concat(changes.InsertedIndices).ToArray();
if (selectedSetMarkedDeleted && modifiedAndInserted.Any())
{
// If it is no longer valid, make the bold assumption that an updated version will be available in the modified indices.
// This relies on the full update operation being in a single transaction, so please don't change that.
foreach (int i in changes.NewModifiedIndices)
foreach (int i in modifiedAndInserted)
{
var beatmapSetInfo = sender[i];