1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 11:23:00 +08:00

APIBeatmapSet.Covers is never null

This commit is contained in:
Dean Herbert 2021-10-21 19:34:01 +09:00
parent 0fe0b5dc09
commit c580ec865f
5 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ using Newtonsoft.Json;
namespace osu.Game.Beatmaps
{
public class BeatmapSetOnlineCovers
public struct BeatmapSetOnlineCovers
{
public string CoverLowRes { get; set; }

View File

@ -50,7 +50,7 @@ namespace osu.Game.Beatmaps
/// <summary>
/// The different sizes of cover art for this beatmap set.
/// </summary>
BeatmapSetOnlineCovers? Covers { get; set; }
BeatmapSetOnlineCovers Covers { get; set; }
/// <summary>
/// A small sample clip of this beatmap set's song.

View File

@ -16,7 +16,7 @@ namespace osu.Game.Online.API.Requests.Responses
public class APIBeatmapSet : BeatmapMetadata, IBeatmapSetOnlineInfo, IBeatmapSetInfo
{
[JsonProperty(@"covers")]
public BeatmapSetOnlineCovers? Covers { get; set; }
public BeatmapSetOnlineCovers Covers { get; set; }
[JsonProperty(@"id")]
public int OnlineID { get; set; }

View File

@ -61,7 +61,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
{
var beatmap = playlistItem?.Beatmap.Value;
if (background?.BeatmapInfo?.BeatmapSet?.OnlineInfo?.Covers?.Cover == beatmap?.BeatmapSet?.OnlineInfo?.Covers?.Cover)
if (background?.BeatmapInfo?.BeatmapSet?.OnlineInfo?.Covers.Cover == beatmap?.BeatmapSet?.OnlineInfo?.Covers.Cover)
return;
cancellationSource?.Cancel();

View File

@ -26,7 +26,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
Texture? texture = null;
// prefer online cover where available.
if (BeatmapInfo?.BeatmapSet?.OnlineInfo?.Covers?.Cover != null)
if (BeatmapInfo?.BeatmapSet?.OnlineInfo?.Covers.Cover != null)
texture = textures.Get(BeatmapInfo.BeatmapSet.OnlineInfo.Covers.Cover);
Sprite.Texture = texture ?? beatmaps.DefaultBeatmap.Background;