2017-09-09 04:23:42 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using osu.Game.Beatmaps;
|
2017-09-09 01:07:28 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.API.Requests
|
|
|
|
|
{
|
|
|
|
|
public class DownloadBeatmapSetRequest : APIDownloadRequest
|
|
|
|
|
{
|
2017-09-09 12:21:37 +08:00
|
|
|
|
public readonly BeatmapSetInfo BeatmapSet;
|
2017-09-09 01:07:28 +08:00
|
|
|
|
|
|
|
|
|
public Action<float> DownloadProgressed;
|
|
|
|
|
|
2017-11-05 19:03:58 +08:00
|
|
|
|
private readonly bool noVideo;
|
|
|
|
|
|
|
|
|
|
public DownloadBeatmapSetRequest(BeatmapSetInfo set, bool noVideo)
|
2017-09-09 01:07:28 +08:00
|
|
|
|
{
|
2017-11-05 19:03:58 +08:00
|
|
|
|
this.noVideo = noVideo;
|
2017-09-09 12:21:37 +08:00
|
|
|
|
BeatmapSet = set;
|
2017-09-09 01:07:28 +08:00
|
|
|
|
|
|
|
|
|
Progress += (current, total) => DownloadProgressed?.Invoke((float) current / total);
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-05 19:03:58 +08:00
|
|
|
|
protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download{(noVideo ? "?noVideo=1" : "")}";
|
2017-09-09 01:07:28 +08:00
|
|
|
|
}
|
|
|
|
|
}
|