mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 09:23:06 +08:00
APIBeatmapSet.Covers
is never null
This commit is contained in:
parent
0fe0b5dc09
commit
c580ec865f
@ -5,7 +5,7 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace osu.Game.Beatmaps
|
||||
{
|
||||
public class BeatmapSetOnlineCovers
|
||||
public struct BeatmapSetOnlineCovers
|
||||
{
|
||||
public string CoverLowRes { get; set; }
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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; }
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user