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 namespace osu.Game.Beatmaps
{ {
public class BeatmapSetOnlineCovers public struct BeatmapSetOnlineCovers
{ {
public string CoverLowRes { get; set; } public string CoverLowRes { get; set; }

View File

@ -50,7 +50,7 @@ namespace osu.Game.Beatmaps
/// <summary> /// <summary>
/// The different sizes of cover art for this beatmap set. /// The different sizes of cover art for this beatmap set.
/// </summary> /// </summary>
BeatmapSetOnlineCovers? Covers { get; set; } BeatmapSetOnlineCovers Covers { get; set; }
/// <summary> /// <summary>
/// A small sample clip of this beatmap set's song. /// 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 public class APIBeatmapSet : BeatmapMetadata, IBeatmapSetOnlineInfo, IBeatmapSetInfo
{ {
[JsonProperty(@"covers")] [JsonProperty(@"covers")]
public BeatmapSetOnlineCovers? Covers { get; set; } public BeatmapSetOnlineCovers Covers { get; set; }
[JsonProperty(@"id")] [JsonProperty(@"id")]
public int OnlineID { get; set; } public int OnlineID { get; set; }

View File

@ -61,7 +61,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
{ {
var beatmap = playlistItem?.Beatmap.Value; 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; return;
cancellationSource?.Cancel(); cancellationSource?.Cancel();

View File

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