1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

Don't assign server-fetched online id if it was assigned elsewhere

This commit is contained in:
Dean Herbert 2019-11-14 18:54:03 +09:00
parent 1bc0eae2a6
commit fbf81207d4

View File

@ -399,7 +399,11 @@ namespace osu.Game.Beatmaps
beatmap.Status = res.Status; beatmap.Status = res.Status;
beatmap.BeatmapSet.Status = res.BeatmapSet.Status; beatmap.BeatmapSet.Status = res.BeatmapSet.Status;
beatmap.BeatmapSet.OnlineBeatmapSetID = res.OnlineBeatmapSetID; beatmap.BeatmapSet.OnlineBeatmapSetID = res.OnlineBeatmapSetID;
beatmap.OnlineBeatmapID = res.OnlineBeatmapID;
// note that this check only needs to be here if two identical hashed beatmaps exist int he same import.
// probably fine to leave it for safety.
if (set.Beatmaps.All(b => b.OnlineBeatmapID != res.OnlineBeatmapID))
beatmap.OnlineBeatmapID = res.OnlineBeatmapID;
LogForModel(set, $"Online retrieval mapped {beatmap} to {res.OnlineBeatmapSetID} / {res.OnlineBeatmapID}."); LogForModel(set, $"Online retrieval mapped {beatmap} to {res.OnlineBeatmapSetID} / {res.OnlineBeatmapID}.");
} }