mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Merge branch 'master' into comment-deletion
This commit is contained in:
@ -9,27 +9,25 @@ namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetBeatmapRequest : APIRequest<APIBeatmap>
|
||||
{
|
||||
private readonly IBeatmapInfo beatmapInfo;
|
||||
|
||||
private readonly string filename;
|
||||
public readonly IBeatmapInfo BeatmapInfo;
|
||||
public readonly string Filename;
|
||||
|
||||
public GetBeatmapRequest(IBeatmapInfo beatmapInfo)
|
||||
{
|
||||
this.beatmapInfo = beatmapInfo;
|
||||
|
||||
filename = (beatmapInfo as BeatmapInfo)?.Path ?? string.Empty;
|
||||
BeatmapInfo = beatmapInfo;
|
||||
Filename = (beatmapInfo as BeatmapInfo)?.Path ?? string.Empty;
|
||||
}
|
||||
|
||||
protected override WebRequest CreateWebRequest()
|
||||
{
|
||||
var request = base.CreateWebRequest();
|
||||
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user