Merge remote-tracking branch 'upstream/master' into not-available-to-download

This commit is contained in:
Dean Herbert
2019-06-27 11:44:41 +09:00
39 changed files with 664 additions and 466 deletions

View File

@ -2,28 +2,19 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Beatmaps;
using System;
namespace osu.Game.Online.API.Requests
{
public class DownloadBeatmapSetRequest : APIDownloadRequest
public class DownloadBeatmapSetRequest : ArchiveDownloadRequest<BeatmapSetInfo>
{
public readonly BeatmapSetInfo BeatmapSet;
public float Progress;
public event Action<float> DownloadProgressed;
private readonly bool noVideo;
public DownloadBeatmapSetRequest(BeatmapSetInfo set, bool noVideo)
: base(set)
{
this.noVideo = noVideo;
BeatmapSet = set;
Progressed += (current, total) => DownloadProgressed?.Invoke(Progress = (float)current / total);
}
protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download{(noVideo ? "?noVideo=1" : "")}";
protected override string Target => $@"beatmapsets/{Model.OnlineBeatmapSetID}/download{(noVideo ? "?noVideo=1" : "")}";
}
}