1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 22:27:46 +08:00

Update GetBeatmapRequest to use AddParameter

This commit is contained in:
Dean Herbert 2021-10-26 12:04:18 +09:00
parent 67ef1c40e6
commit d7ac94038a

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.IO.Network;
using osu.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses;
@ -21,6 +22,17 @@ namespace osu.Game.Online.API.Requests
filename = (beatmapInfo as BeatmapInfo)?.Path ?? string.Empty;
}
protected override string Target => $@"beatmaps/lookup?id={beatmapInfo.OnlineID}&checksum={beatmapInfo.MD5Hash}&filename={System.Uri.EscapeUriString(filename)}";
protected override WebRequest CreateWebRequest()
{
var request = base.CreateWebRequest();
request.AddParameter(@"id", beatmapInfo.OnlineID.ToString());
request.AddParameter(@"checksum", beatmapInfo.MD5Hash);
request.AddParameter(@"filename", filename);
return request;
}
protected override string Target => @"beatmaps/lookup";
}
}