2021-09-30 09:21:16 +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.
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2021-09-30 09:21:16 +00:00
|
|
|
using osu.Game.Database;
|
2021-12-10 09:32:06 +00:00
|
|
|
using osu.Game.Extensions;
|
2021-09-30 09:21:16 +00:00
|
|
|
using osu.Game.Online.API;
|
|
|
|
using osu.Game.Online.API.Requests;
|
|
|
|
|
|
|
|
namespace osu.Game.Scoring
|
|
|
|
{
|
2021-11-05 08:37:05 +00:00
|
|
|
public class ScoreModelDownloader : ModelDownloader<ScoreInfo, IScoreInfo>
|
2021-09-30 09:21:16 +00:00
|
|
|
{
|
2021-11-25 08:42:41 +00:00
|
|
|
public ScoreModelDownloader(IModelImporter<ScoreInfo> scoreManager, IAPIProvider api)
|
|
|
|
: base(scoreManager, api)
|
2021-09-30 09:21:16 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-11-05 08:37:05 +00:00
|
|
|
protected override ArchiveDownloadRequest<IScoreInfo> CreateDownloadRequest(IScoreInfo score, bool minimiseDownload) => new DownloadReplayRequest(score);
|
2021-10-27 11:02:51 +00:00
|
|
|
|
2021-11-05 08:37:05 +00:00
|
|
|
public override ArchiveDownloadRequest<IScoreInfo> GetExistingDownload(IScoreInfo model)
|
2021-12-10 09:32:06 +00:00
|
|
|
=> CurrentDownloads.Find(r => r.Model.MatchesOnlineID(model));
|
2021-09-30 09:21:16 +00:00
|
|
|
}
|
|
|
|
}
|