2019-01-24 16:43:03 +08: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-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.API.Requests
|
|
|
|
|
{
|
|
|
|
|
public class DownloadBeatmapSetRequest : APIDownloadRequest
|
|
|
|
|
{
|
|
|
|
|
public readonly BeatmapSetInfo BeatmapSet;
|
|
|
|
|
|
2019-01-18 13:28:06 +08:00
|
|
|
|
public event Action<float> DownloadProgressed;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
private readonly bool noVideo;
|
|
|
|
|
|
|
|
|
|
public DownloadBeatmapSetRequest(BeatmapSetInfo set, bool noVideo)
|
|
|
|
|
{
|
|
|
|
|
this.noVideo = noVideo;
|
|
|
|
|
BeatmapSet = set;
|
|
|
|
|
|
|
|
|
|
Progress += (current, total) => DownloadProgressed?.Invoke((float) current / total);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download{(noVideo ? "?noVideo=1" : "")}";
|
|
|
|
|
}
|
|
|
|
|
}
|