1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +08:00

Avoid sending empty parameters in GetBeatmapRequest

This commit is contained in:
Dean Herbert 2021-12-03 16:23:39 +09:00
parent bd5140cbdf
commit dad5b06e84

View File

@ -26,9 +26,12 @@ namespace osu.Game.Online.API.Requests
{
var request = base.CreateWebRequest();
request.AddParameter(@"id", beatmapInfo.OnlineID.ToString());
request.AddParameter(@"checksum", beatmapInfo.MD5Hash);
request.AddParameter(@"filename", filename);
if (beatmapInfo.OnlineID > 0)
request.AddParameter(@"id", beatmapInfo.OnlineID.ToString());
if (!string.IsNullOrEmpty(beatmapInfo.MD5Hash))
request.AddParameter(@"checksum", beatmapInfo.MD5Hash);
if (!string.IsNullOrEmpty(filename))
request.AddParameter(@"filename", filename);
return request;
}