mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Merge branch 'master' into generic-download-model-manager
This commit is contained in:
@ -1,20 +0,0 @@
|
||||
// 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.
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetBeatmapDetailsRequest : APIRequest<APIBeatmapMetrics>
|
||||
{
|
||||
private readonly BeatmapInfo beatmap;
|
||||
|
||||
public GetBeatmapDetailsRequest(BeatmapInfo beatmap)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
}
|
||||
|
||||
protected override string Target => $@"beatmaps/{beatmap.OnlineBeatmapID}";
|
||||
}
|
||||
}
|
@ -57,6 +57,9 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"version")]
|
||||
private string version { get; set; }
|
||||
|
||||
[JsonProperty(@"failtimes")]
|
||||
private BeatmapMetrics metrics { get; set; }
|
||||
|
||||
public BeatmapInfo ToBeatmap(RulesetStore rulesets)
|
||||
{
|
||||
var set = BeatmapSet?.ToBeatmapSet(rulesets);
|
||||
@ -70,6 +73,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
Version = version,
|
||||
Status = Status,
|
||||
BeatmapSet = set,
|
||||
Metrics = metrics,
|
||||
BaseDifficulty = new BeatmapDifficulty
|
||||
{
|
||||
DrainRate = drainRate,
|
||||
|
@ -1,29 +0,0 @@
|
||||
// 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.
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Beatmaps;
|
||||
|
||||
namespace osu.Game.Online.API.Requests.Responses
|
||||
{
|
||||
public class APIBeatmapMetrics : BeatmapMetrics
|
||||
{
|
||||
//the online API returns some metrics as a nested object.
|
||||
[JsonProperty(@"failtimes")]
|
||||
private BeatmapMetrics failTimes
|
||||
{
|
||||
set
|
||||
{
|
||||
Fails = value.Fails;
|
||||
Retries = value.Retries;
|
||||
}
|
||||
}
|
||||
|
||||
//and other metrics in the beatmap set.
|
||||
[JsonProperty(@"beatmapset")]
|
||||
private BeatmapMetrics beatmapSet
|
||||
{
|
||||
set => Ratings = value.Ratings;
|
||||
}
|
||||
}
|
||||
}
|
@ -54,6 +54,9 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"last_updated")]
|
||||
private DateTimeOffset lastUpdated { get; set; }
|
||||
|
||||
[JsonProperty(@"ratings")]
|
||||
private int[] ratings { get; set; }
|
||||
|
||||
[JsonProperty(@"user_id")]
|
||||
private long creatorId
|
||||
{
|
||||
@ -70,6 +73,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
OnlineBeatmapSetID = OnlineBeatmapSetID,
|
||||
Metadata = this,
|
||||
Status = Status,
|
||||
Metrics = ratings == null ? null : new BeatmapSetMetrics { Ratings = ratings },
|
||||
OnlineInfo = new BeatmapSetOnlineInfo
|
||||
{
|
||||
Covers = covers,
|
||||
|
@ -31,9 +31,9 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public List<APIChangelogEntry> ChangelogEntries { get; set; }
|
||||
|
||||
[JsonProperty("versions")]
|
||||
public VersionNatigation Versions { get; set; }
|
||||
public VersionNavigation Versions { get; set; }
|
||||
|
||||
public class VersionNatigation
|
||||
public class VersionNavigation
|
||||
{
|
||||
[JsonProperty("next")]
|
||||
public APIChangelogBuild Next { get; set; }
|
||||
|
@ -30,7 +30,10 @@ namespace osu.Game.Online.API.Requests
|
||||
req.ContentType = "application/json";
|
||||
req.Method = HttpMethod.Put;
|
||||
|
||||
req.AddRaw(JsonConvert.SerializeObject(scoreInfo));
|
||||
req.AddRaw(JsonConvert.SerializeObject(scoreInfo, new JsonSerializerSettings
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
|
||||
}));
|
||||
|
||||
return req;
|
||||
}
|
||||
|
Reference in New Issue
Block a user