From 69e7810dad46f6529fd2753479b5a39fe318fc60 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Oct 2021 18:53:49 +0900 Subject: [PATCH 1/4] Enable `nullable` and switch classes to structs --- osu.Game/Beatmaps/BeatmapSetOnlineAvailability.cs | 2 +- osu.Game/Beatmaps/BeatmapSetOnlineGenre.cs | 2 +- osu.Game/Beatmaps/BeatmapSetOnlineLanguage.cs | 2 +- osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs | 4 +++- .../BeatmapListing/Panels/BeatmapPanelDownloadButton.cs | 2 +- osu.Game/Overlays/BeatmapSet/BeatmapAvailability.cs | 4 ++-- osu.Game/Overlays/BeatmapSet/BeatmapSetHeaderContent.cs | 2 +- osu.Game/Overlays/BeatmapSet/Info.cs | 4 ++-- .../Sections/Beatmaps/PaginatedBeatmapContainer.cs | 8 ++++---- .../OnlinePlay/Components/PlaylistItemBackground.cs | 2 +- 10 files changed, 17 insertions(+), 15 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineAvailability.cs b/osu.Game/Beatmaps/BeatmapSetOnlineAvailability.cs index 8c67aa2404..14a63f3279 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineAvailability.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineAvailability.cs @@ -5,7 +5,7 @@ using Newtonsoft.Json; namespace osu.Game.Beatmaps { - public class BeatmapSetOnlineAvailability + public struct BeatmapSetOnlineAvailability { [JsonProperty(@"download_disabled")] public bool DownloadDisabled { get; set; } diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineGenre.cs b/osu.Game/Beatmaps/BeatmapSetOnlineGenre.cs index 65d6dfe5d9..e727e2c37f 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineGenre.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineGenre.cs @@ -3,7 +3,7 @@ namespace osu.Game.Beatmaps { - public class BeatmapSetOnlineGenre + public struct BeatmapSetOnlineGenre { public int Id { get; set; } public string Name { get; set; } diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineLanguage.cs b/osu.Game/Beatmaps/BeatmapSetOnlineLanguage.cs index 057325f319..658e5a4005 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineLanguage.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineLanguage.cs @@ -3,7 +3,7 @@ namespace osu.Game.Beatmaps { - public class BeatmapSetOnlineLanguage + public struct BeatmapSetOnlineLanguage { public int Id { get; set; } public string Name { get; set; } diff --git a/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs b/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs index f365a59c1b..1cd363f7b6 100644 --- a/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs +++ b/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs @@ -3,6 +3,8 @@ using System; +#nullable enable + namespace osu.Game.Beatmaps { /// @@ -48,7 +50,7 @@ namespace osu.Game.Beatmaps /// /// The different sizes of cover art for this beatmap set. /// - BeatmapSetOnlineCovers Covers { get; set; } + BeatmapSetOnlineCovers? Covers { get; set; } /// /// A small sample clip of this beatmap set's song. diff --git a/osu.Game/Overlays/BeatmapListing/Panels/BeatmapPanelDownloadButton.cs b/osu.Game/Overlays/BeatmapListing/Panels/BeatmapPanelDownloadButton.cs index 47b477ef9a..a8c4334ffb 100644 --- a/osu.Game/Overlays/BeatmapListing/Panels/BeatmapPanelDownloadButton.cs +++ b/osu.Game/Overlays/BeatmapListing/Panels/BeatmapPanelDownloadButton.cs @@ -92,7 +92,7 @@ namespace osu.Game.Overlays.BeatmapListing.Panels break; default: - if (BeatmapSet.Value?.OnlineInfo?.Availability?.DownloadDisabled ?? false) + if (BeatmapSet.Value?.OnlineInfo?.Availability.DownloadDisabled ?? false) { button.Enabled.Value = false; button.TooltipText = "this beatmap is currently not available for download."; diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapAvailability.cs b/osu.Game/Overlays/BeatmapSet/BeatmapAvailability.cs index 896c646552..f005a37eaa 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapAvailability.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapAvailability.cs @@ -16,8 +16,8 @@ namespace osu.Game.Overlays.BeatmapSet { private BeatmapSetInfo beatmapSet; - private bool downloadDisabled => BeatmapSet?.OnlineInfo.Availability?.DownloadDisabled ?? false; - private bool hasExternalLink => !string.IsNullOrEmpty(BeatmapSet?.OnlineInfo.Availability?.ExternalLink); + private bool downloadDisabled => BeatmapSet?.OnlineInfo.Availability.DownloadDisabled ?? false; + private bool hasExternalLink => !string.IsNullOrEmpty(BeatmapSet?.OnlineInfo.Availability.ExternalLink); private readonly LinkFlowContainer textContainer; diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapSetHeaderContent.cs b/osu.Game/Overlays/BeatmapSet/BeatmapSetHeaderContent.cs index fc2f90807e..c1029923f7 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapSetHeaderContent.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapSetHeaderContent.cs @@ -266,7 +266,7 @@ namespace osu.Game.Overlays.BeatmapSet { if (BeatmapSet.Value == null) return; - if ((BeatmapSet.Value.OnlineInfo.Availability?.DownloadDisabled ?? false) && State.Value != DownloadState.LocallyAvailable) + if (BeatmapSet.Value.OnlineInfo.Availability.DownloadDisabled && State.Value != DownloadState.LocallyAvailable) { downloadButtonsContainer.Clear(); return; diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs index 61c660cbaa..8bc5c6d27e 100644 --- a/osu.Game/Overlays/BeatmapSet/Info.cs +++ b/osu.Game/Overlays/BeatmapSet/Info.cs @@ -117,8 +117,8 @@ namespace osu.Game.Overlays.BeatmapSet { source.Text = b.NewValue?.Metadata.Source ?? string.Empty; tags.Text = b.NewValue?.Metadata.Tags ?? string.Empty; - genre.Text = b.NewValue?.OnlineInfo?.Genre?.Name ?? string.Empty; - language.Text = b.NewValue?.OnlineInfo?.Language?.Name ?? string.Empty; + genre.Text = b.NewValue?.OnlineInfo?.Genre.Name ?? string.Empty; + language.Text = b.NewValue?.OnlineInfo?.Language.Name ?? string.Empty; var setHasLeaderboard = b.NewValue?.OnlineInfo?.Status > 0; successRate.Alpha = setHasLeaderboard ? 1 : 0; notRankedPlaceholder.Alpha = setHasLeaderboard ? 0 : 1; diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 8657e356c9..c1e56facd9 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -60,12 +60,12 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps protected override APIRequest> CreateRequest() => new GetUserBeatmapsRequest(User.Value.Id, type, VisiblePages++, ItemsPerPage); - protected override Drawable CreateDrawableItem(APIBeatmapSet model) => !model.OnlineBeatmapSetID.HasValue - ? null - : new GridBeatmapPanel(model.ToBeatmapSet(Rulesets)) + protected override Drawable CreateDrawableItem(APIBeatmapSet model) => model.OnlineID > 0 + ? new GridBeatmapPanel(model.ToBeatmapSet(Rulesets)) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - }; + } + : null; } } diff --git a/osu.Game/Screens/OnlinePlay/Components/PlaylistItemBackground.cs b/osu.Game/Screens/OnlinePlay/Components/PlaylistItemBackground.cs index 90ad6e0f6e..c2ceef292c 100644 --- a/osu.Game/Screens/OnlinePlay/Components/PlaylistItemBackground.cs +++ b/osu.Game/Screens/OnlinePlay/Components/PlaylistItemBackground.cs @@ -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; From 40a176e86e6ef829c43a25b4343850966374b5e6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Oct 2021 18:54:21 +0900 Subject: [PATCH 2/4] `APIBeatmapSet` implements `IBeatmapSetInfo` --- .../API/Requests/Responses/APIBeatmapSet.cs | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs b/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs index 25d69c2797..c445a69126 100644 --- a/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs +++ b/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs @@ -6,29 +6,26 @@ using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using osu.Game.Beatmaps; +using osu.Game.Database; using osu.Game.Rulesets; +#nullable enable + namespace osu.Game.Online.API.Requests.Responses { - public class APIBeatmapSet : BeatmapMetadata, IBeatmapSetOnlineInfo + public class APIBeatmapSet : BeatmapMetadata, IBeatmapSetOnlineInfo, IBeatmapSetInfo { [JsonProperty(@"covers")] - public BeatmapSetOnlineCovers Covers { get; set; } - - private int? onlineBeatmapSetID; + public BeatmapSetOnlineCovers? Covers { get; set; } [JsonProperty(@"id")] - public int? OnlineBeatmapSetID - { - get => onlineBeatmapSetID; - set => onlineBeatmapSetID = value > 0 ? value : null; - } + public int OnlineID { get; set; } [JsonProperty(@"status")] public BeatmapSetOnlineStatus Status { get; set; } [JsonProperty(@"preview_url")] - public string Preview { get; set; } + public string Preview { get; set; } = string.Empty; [JsonProperty(@"has_favourited")] public bool HasFavourited { get; set; } @@ -61,7 +58,7 @@ namespace osu.Game.Online.API.Requests.Responses public DateTimeOffset? LastUpdated { get; set; } [JsonProperty(@"ratings")] - private int[] ratings { get; set; } + private int[] ratings { get; set; } = Array.Empty(); [JsonProperty(@"track_id")] public int? TrackId { get; set; } @@ -82,20 +79,20 @@ namespace osu.Game.Online.API.Requests.Responses public BeatmapSetOnlineLanguage Language { get; set; } [JsonProperty(@"beatmaps")] - private IEnumerable beatmaps { get; set; } + private IEnumerable beatmaps { get; set; } = Array.Empty(); public virtual BeatmapSetInfo ToBeatmapSet(RulesetStore rulesets) { var beatmapSet = new BeatmapSetInfo { - OnlineBeatmapSetID = OnlineBeatmapSetID, + OnlineBeatmapSetID = OnlineID, Metadata = this, Status = Status, - Metrics = ratings == null ? null : new BeatmapSetMetrics { Ratings = ratings }, + Metrics = new BeatmapSetMetrics { Ratings = ratings }, OnlineInfo = this }; - beatmapSet.Beatmaps = beatmaps?.Select(b => + beatmapSet.Beatmaps = beatmaps.Select(b => { var beatmap = b.ToBeatmapInfo(rulesets); beatmap.BeatmapSet = beatmapSet; @@ -105,5 +102,19 @@ namespace osu.Game.Online.API.Requests.Responses return beatmapSet; } + + #region Implementation of IBeatmapSetInfo + + IEnumerable IBeatmapSetInfo.Beatmaps => beatmaps; + + IBeatmapMetadataInfo IBeatmapSetInfo.Metadata => this; + + DateTimeOffset IBeatmapSetInfo.DateAdded => throw new NotImplementedException(); + IEnumerable IBeatmapSetInfo.Files => throw new NotImplementedException(); + double IBeatmapSetInfo.MaxStarDifficulty => throw new NotImplementedException(); + double IBeatmapSetInfo.MaxLength => throw new NotImplementedException(); + double IBeatmapSetInfo.MaxBPM => throw new NotImplementedException(); + + #endregion } } From 0fe0b5dc0999965f2a01e41aae0e703e5edf917b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Oct 2021 19:14:31 +0900 Subject: [PATCH 3/4] `APIBeatmap` implements `IBeatmapInfo` --- osu.Game/Beatmaps/BeatmapOnlineLookupQueue.cs | 6 +-- .../API/Requests/Responses/APIBeatmap.cs | 53 ++++++++++++++----- 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapOnlineLookupQueue.cs b/osu.Game/Beatmaps/BeatmapOnlineLookupQueue.cs index 1fe120557d..b05ad9a1dd 100644 --- a/osu.Game/Beatmaps/BeatmapOnlineLookupQueue.cs +++ b/osu.Game/Beatmaps/BeatmapOnlineLookupQueue.cs @@ -83,9 +83,9 @@ namespace osu.Game.Beatmaps if (res != null) { beatmapInfo.Status = res.Status; - beatmapInfo.BeatmapSet.Status = res.BeatmapSet.Status; + beatmapInfo.BeatmapSet.Status = res.BeatmapSet?.Status ?? BeatmapSetOnlineStatus.None; beatmapInfo.BeatmapSet.OnlineBeatmapSetID = res.OnlineBeatmapSetID; - beatmapInfo.OnlineBeatmapID = res.OnlineBeatmapID; + beatmapInfo.OnlineBeatmapID = res.OnlineID; if (beatmapInfo.Metadata != null) beatmapInfo.Metadata.AuthorID = res.AuthorID; @@ -93,7 +93,7 @@ namespace osu.Game.Beatmaps if (beatmapInfo.BeatmapSet.Metadata != null) beatmapInfo.BeatmapSet.Metadata.AuthorID = res.AuthorID; - logForModel(set, $"Online retrieval mapped {beatmapInfo} to {res.OnlineBeatmapSetID} / {res.OnlineBeatmapID}."); + logForModel(set, $"Online retrieval mapped {beatmapInfo} to {res.OnlineBeatmapSetID} / {res.OnlineID}."); } } catch (Exception e) diff --git a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs index ea4265e641..42e519223b 100644 --- a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs +++ b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs @@ -6,12 +6,14 @@ using Newtonsoft.Json; using osu.Game.Beatmaps; using osu.Game.Rulesets; +#nullable enable + namespace osu.Game.Online.API.Requests.Responses { - public class APIBeatmap : BeatmapMetadata + public class APIBeatmap : BeatmapMetadata, IBeatmapInfo { [JsonProperty(@"id")] - public int OnlineBeatmapID { get; set; } + public int OnlineID { get; set; } [JsonProperty(@"beatmapset_id")] public int OnlineBeatmapSetID { get; set; } @@ -20,10 +22,10 @@ namespace osu.Game.Online.API.Requests.Responses public BeatmapSetOnlineStatus Status { get; set; } [JsonProperty("checksum")] - public string Checksum { get; set; } + public string Checksum { get; set; } = string.Empty; [JsonProperty(@"beatmapset")] - public APIBeatmapSet BeatmapSet { get; set; } + public APIBeatmapSet? BeatmapSet { get; set; } [JsonProperty(@"playcount")] private int playCount { get; set; } @@ -32,10 +34,10 @@ namespace osu.Game.Online.API.Requests.Responses private int passCount { get; set; } [JsonProperty(@"mode_int")] - private int ruleset { get; set; } + public int RulesetID { get; set; } [JsonProperty(@"difficulty_rating")] - private double starDifficulty { get; set; } + public double StarRating { get; set; } [JsonProperty(@"drain")] private float drainRate { get; set; } @@ -50,7 +52,7 @@ namespace osu.Game.Online.API.Requests.Responses private float overallDifficulty { get; set; } [JsonProperty(@"total_length")] - private double length { get; set; } + public double Length { get; set; } [JsonProperty(@"count_circles")] private int circleCount { get; set; } @@ -59,10 +61,10 @@ namespace osu.Game.Online.API.Requests.Responses private int sliderCount { get; set; } [JsonProperty(@"version")] - private string version { get; set; } + public string DifficultyName { get; set; } = string.Empty; [JsonProperty(@"failtimes")] - private BeatmapMetrics metrics { get; set; } + private BeatmapMetrics? metrics { get; set; } [JsonProperty(@"max_combo")] private int? maxCombo { get; set; } @@ -74,12 +76,12 @@ namespace osu.Game.Online.API.Requests.Responses return new BeatmapInfo { Metadata = set?.Metadata ?? this, - Ruleset = rulesets.GetRuleset(ruleset), - StarDifficulty = starDifficulty, - OnlineBeatmapID = OnlineBeatmapID, - Version = version, + Ruleset = rulesets.GetRuleset(RulesetID), + StarDifficulty = StarRating, + OnlineBeatmapID = OnlineID, + Version = DifficultyName, // this is actually an incorrect mapping (Length is calculated as drain length in lazer's import process, see BeatmapManager.calculateLength). - Length = TimeSpan.FromSeconds(length).TotalMilliseconds, + Length = TimeSpan.FromSeconds(Length).TotalMilliseconds, Status = Status, MD5Hash = Checksum, BeatmapSet = set, @@ -101,5 +103,28 @@ namespace osu.Game.Online.API.Requests.Responses }, }; } + + #region Implementation of IBeatmapInfo + + public IBeatmapMetadataInfo Metadata => this; + + public IBeatmapDifficultyInfo Difficulty => new BeatmapDifficulty + { + DrainRate = drainRate, + CircleSize = circleSize, + ApproachRate = approachRate, + OverallDifficulty = overallDifficulty, + }; + + IBeatmapSetInfo? IBeatmapInfo.BeatmapSet => BeatmapSet; + + public string MD5Hash => Checksum; + + public IRulesetInfo Ruleset => new RulesetInfo { ID = RulesetID }; + + public double BPM => throw new NotImplementedException(); + public string Hash => throw new NotImplementedException(); + + #endregion } } From c580ec865f5c40fcf3548767350ef686bf30f1ae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Oct 2021 19:34:01 +0900 Subject: [PATCH 4/4] `APIBeatmapSet.Covers` is never null --- osu.Game/Beatmaps/BeatmapSetOnlineCovers.cs | 2 +- osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs | 2 +- osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs | 2 +- .../Screens/OnlinePlay/Components/OnlinePlayBackgroundScreen.cs | 2 +- .../Screens/OnlinePlay/Components/PlaylistItemBackground.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineCovers.cs b/osu.Game/Beatmaps/BeatmapSetOnlineCovers.cs index 8d6e85391d..aad31befa8 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineCovers.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineCovers.cs @@ -5,7 +5,7 @@ using Newtonsoft.Json; namespace osu.Game.Beatmaps { - public class BeatmapSetOnlineCovers + public struct BeatmapSetOnlineCovers { public string CoverLowRes { get; set; } diff --git a/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs b/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs index 1cd363f7b6..b9800bc2e6 100644 --- a/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs +++ b/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs @@ -50,7 +50,7 @@ namespace osu.Game.Beatmaps /// /// The different sizes of cover art for this beatmap set. /// - BeatmapSetOnlineCovers? Covers { get; set; } + BeatmapSetOnlineCovers Covers { get; set; } /// /// A small sample clip of this beatmap set's song. diff --git a/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs b/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs index c445a69126..47f880cf54 100644 --- a/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs +++ b/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs @@ -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; } diff --git a/osu.Game/Screens/OnlinePlay/Components/OnlinePlayBackgroundScreen.cs b/osu.Game/Screens/OnlinePlay/Components/OnlinePlayBackgroundScreen.cs index 6ce5f6a6db..8b6077b9f2 100644 --- a/osu.Game/Screens/OnlinePlay/Components/OnlinePlayBackgroundScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Components/OnlinePlayBackgroundScreen.cs @@ -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(); diff --git a/osu.Game/Screens/OnlinePlay/Components/PlaylistItemBackground.cs b/osu.Game/Screens/OnlinePlay/Components/PlaylistItemBackground.cs index c2ceef292c..90ad6e0f6e 100644 --- a/osu.Game/Screens/OnlinePlay/Components/PlaylistItemBackground.cs +++ b/osu.Game/Screens/OnlinePlay/Components/PlaylistItemBackground.cs @@ -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;