1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 03:02:54 +08:00

Set locally modified state for all externally modified beatmap(sets) that could not be mapped to online

This commit is contained in:
Bartłomiej Dach 2024-07-11 09:43:20 +02:00
parent a859978efd
commit ac467cf73a
No known key found for this signature in database

View File

@ -204,6 +204,16 @@ namespace osu.Game.Screens.Edit
this.Exit();
else
{
// the `ImportAsUpdate()` flow will yield beatmap(sets) with online status of `None` if online lookup fails.
// coerce such models to `LocallyModified` state instead to unify behaviour with normal editing flow.
beatmap.PerformWrite(s =>
{
if (s.Status == BeatmapOnlineStatus.None)
s.Status = BeatmapOnlineStatus.LocallyModified;
foreach (var difficulty in s.Beatmaps.Where(b => b.Status == BeatmapOnlineStatus.None))
difficulty.Status = BeatmapOnlineStatus.LocallyModified;
});
var closestMatchingBeatmap =
beatmap.Value.Beatmaps.FirstOrDefault(b => b.DifficultyName == originalDifficulty)
?? beatmap.Value.Beatmaps.First();