Update null fallback cases involving OnlineID

This commit is contained in:
Dean Herbert
2021-11-22 14:55:41 +09:00
parent 37673f4cf8
commit 213d89b479
12 changed files with 20 additions and 20 deletions

View File

@ -101,7 +101,7 @@ namespace osu.Game.Beatmaps
{
if (beatmapSet.OnlineID != null)
{
beatmapSet.OnlineID = null;
beatmapSet.OnlineID = -1;
LogForModel(beatmapSet, "Disassociating beatmap set ID due to loss of all beatmap IDs");
}
}
@ -122,9 +122,9 @@ namespace osu.Game.Beatmaps
Delete(existingSetWithSameOnlineID);
// in order to avoid a unique key constraint, immediately remove the online ID from the previous set.
existingSetWithSameOnlineID.OnlineID = null;
existingSetWithSameOnlineID.OnlineID = -1;
foreach (var b in existingSetWithSameOnlineID.Beatmaps)
b.OnlineID = null;
b.OnlineID = -1;
LogForModel(beatmapSet, $"Found existing beatmap set with same OnlineBeatmapSetID ({beatmapSet.OnlineID}). It has been deleted.");
}
@ -159,7 +159,7 @@ namespace osu.Game.Beatmaps
}
}
void resetIds() => beatmapSet.Beatmaps.ForEach(b => b.OnlineID = null);
void resetIds() => beatmapSet.Beatmaps.ForEach(b => b.OnlineID = -1);
}
/// <summary>