2019-01-24 08:43:03 +00:00
|
|
|
|
// 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.
|
2018-06-08 03:21:12 +00:00
|
|
|
|
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
|
|
|
|
|
2021-10-25 06:59:40 +00:00
|
|
|
|
#nullable enable
|
|
|
|
|
|
2018-06-08 03:21:12 +00:00
|
|
|
|
namespace osu.Game.Online.API.Requests
|
|
|
|
|
{
|
|
|
|
|
public class GetBeatmapRequest : APIRequest<APIBeatmap>
|
|
|
|
|
{
|
2021-10-25 06:59:40 +00:00
|
|
|
|
private readonly IBeatmapInfo beatmapInfo;
|
|
|
|
|
|
|
|
|
|
private readonly string filename;
|
2018-06-08 03:21:12 +00:00
|
|
|
|
|
2021-10-25 06:59:40 +00:00
|
|
|
|
public GetBeatmapRequest(IBeatmapInfo beatmapInfo)
|
2018-06-08 03:21:12 +00:00
|
|
|
|
{
|
2021-10-02 15:55:29 +00:00
|
|
|
|
this.beatmapInfo = beatmapInfo;
|
2021-10-25 06:59:40 +00:00
|
|
|
|
|
|
|
|
|
filename = (beatmapInfo as BeatmapInfo)?.Path ?? string.Empty;
|
2018-06-08 03:21:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-10-25 06:59:40 +00:00
|
|
|
|
protected override string Target => $@"beatmaps/lookup?id={beatmapInfo.OnlineID}&checksum={beatmapInfo.MD5Hash}&filename={System.Uri.EscapeUriString(filename)}";
|
2018-06-08 03:21:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|