mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 11:42:54 +08:00
Refuse to apply online metadata in the most dodgy scenarios
This commit is contained in:
parent
834db989f7
commit
4f0ae4197a
@ -43,7 +43,7 @@ namespace osu.Game.Beatmaps
|
||||
if (!tryLookup(beatmapInfo, preferOnlineFetch, out var res))
|
||||
continue;
|
||||
|
||||
if (res == null)
|
||||
if (res == null || shouldDiscardLookupResult(res, beatmapInfo))
|
||||
{
|
||||
beatmapInfo.ResetOnlineInfo();
|
||||
continue;
|
||||
@ -72,6 +72,17 @@ namespace osu.Game.Beatmaps
|
||||
}
|
||||
}
|
||||
|
||||
private bool shouldDiscardLookupResult(OnlineBeatmapMetadata result, BeatmapInfo beatmapInfo)
|
||||
{
|
||||
if (beatmapInfo.OnlineID > 0 && result.BeatmapID != beatmapInfo.OnlineID)
|
||||
return true;
|
||||
|
||||
if (beatmapInfo.OnlineID == -1 && result.MD5Hash != beatmapInfo.MD5Hash)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to retrieve the <see cref="OnlineBeatmapMetadata"/> for the given <paramref name="beatmapInfo"/>.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user