Check wether a chart is populated; Fixes to graph's colour setting

This commit is contained in:
HoutarouOreki
2018-07-21 09:45:14 +02:00
parent 22af3cd923
commit ba0430752c
3 changed files with 96 additions and 3 deletions

View File

@ -0,0 +1,21 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Online.API.Requests.Responses;
using System.Collections.Generic;
namespace osu.Game.Online.API.Requests
{
public class GetChangelogChartRequest : APIRequest<APIChangelogChart>
{
private readonly string updateStream;
public GetChangelogChartRequest() => updateStream = null;
public GetChangelogChartRequest(string updateStreamName) => updateStream = updateStreamName;
protected override string Target => $@"changelog/{(!string.IsNullOrEmpty(updateStream) ?
updateStream + "/" : "")}chart-config";
protected override string Uri => $@"https://houtarouoreki.github.io/fake-api/{Target}"; // for testing
}
}

View File

@ -0,0 +1,34 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using Newtonsoft.Json;
using osu.Framework.Lists;
using System;
using System.Collections.Generic;
namespace osu.Game.Online.API.Requests.Responses
{
public class APIChangelogChart
{
[JsonProperty("build_history")]
public List<BuildHistory> BuildHistory { get; set; }
[JsonProperty("order")]
public List<string> Order { get; set; }
[JsonProperty("stream_name")]
public string StreamName { get; set; }
}
public class BuildHistory
{
[JsonProperty("created_at")]
public DateTimeOffset CreatedAt { get; set; }
[JsonProperty("user_count")]
public long UserCount { get; set; }
[JsonProperty("label")]
public string Label { get; set; }
}
}