diff --git a/osu.Game.Tests/Visual/Online/TestSceneBeatmapAvailability.cs b/osu.Game.Tests/Visual/Online/TestSceneBeatmapAvailability.cs index fe94165777..6f9744ca73 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneBeatmapAvailability.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneBeatmapAvailability.cs @@ -3,6 +3,7 @@ using NUnit.Framework; using osu.Game.Beatmaps; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays.BeatmapSet; namespace osu.Game.Tests.Visual.Online @@ -22,7 +23,7 @@ namespace osu.Game.Tests.Visual.Online { AddStep("set undownloadable beatmapset with link", () => container.BeatmapSet = new BeatmapSetInfo { - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Availability = new BeatmapSetOnlineAvailability { @@ -40,7 +41,7 @@ namespace osu.Game.Tests.Visual.Online { AddStep("set undownloadable beatmapset without link", () => container.BeatmapSet = new BeatmapSetInfo { - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Availability = new BeatmapSetOnlineAvailability { @@ -57,7 +58,7 @@ namespace osu.Game.Tests.Visual.Online { AddStep("set parts-removed beatmapset with link", () => container.BeatmapSet = new BeatmapSetInfo { - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Availability = new BeatmapSetOnlineAvailability { @@ -75,7 +76,7 @@ namespace osu.Game.Tests.Visual.Online { AddStep("set normal beatmapset", () => container.BeatmapSet = new BeatmapSetInfo { - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Availability = new BeatmapSetOnlineAvailability { diff --git a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs index 453e26ef96..ef89a86e79 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs @@ -11,6 +11,7 @@ using osu.Game.Users; using System; using System.Collections.Generic; using System.Linq; +using osu.Game.Online.API.Requests.Responses; namespace osu.Game.Tests.Visual.Online { @@ -63,7 +64,7 @@ namespace osu.Game.Tests.Visual.Online Id = 3, }, }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Preview = @"https://b.ppy.sh/preview/12345.mp3", PlayCount = 123, @@ -134,7 +135,7 @@ namespace osu.Game.Tests.Visual.Online Id = 3, }, }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Availability = new BeatmapSetOnlineAvailability { @@ -224,7 +225,7 @@ namespace osu.Game.Tests.Visual.Online Id = 3, } }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Covers = new BeatmapSetOnlineCovers(), }, @@ -309,7 +310,7 @@ namespace osu.Game.Tests.Visual.Online Id = 3, }, }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Preview = @"https://b.ppy.sh/preview/123.mp3", HasVideo = true, diff --git a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlayDetails.cs b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlayDetails.cs index f7099b0615..c15c9f44e4 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlayDetails.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlayDetails.cs @@ -8,6 +8,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Utils; using osu.Game.Beatmaps; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; using osu.Game.Overlays.BeatmapSet; using osu.Game.Screens.Select.Details; @@ -57,7 +58,7 @@ namespace osu.Game.Tests.Visual.Online }, } }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Status = BeatmapSetOnlineStatus.Ranked } diff --git a/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs b/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs index 3fc894da0d..bb7fcc2fce 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs @@ -7,6 +7,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Beatmaps; using osu.Game.Online; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays.BeatmapListing.Panels; using osu.Game.Rulesets.Osu; using osu.Game.Tests.Resources; @@ -74,7 +75,7 @@ namespace osu.Game.Tests.Visual.Online { ID = 1, OnlineBeatmapSetID = 241526, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Availability = new BeatmapSetOnlineAvailability { diff --git a/osu.Game.Tests/Visual/Online/TestSceneDirectPanel.cs b/osu.Game.Tests/Visual/Online/TestSceneDirectPanel.cs index 722010ace2..6caca2a67c 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneDirectPanel.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneDirectPanel.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Audio; using osu.Game.Beatmaps; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays.BeatmapListing.Panels; using osu.Game.Rulesets; using osu.Game.Users; @@ -31,7 +32,7 @@ namespace osu.Game.Tests.Visual.Online Id = 3, }, }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Availability = new BeatmapSetOnlineAvailability { @@ -86,7 +87,7 @@ namespace osu.Game.Tests.Visual.Online Id = 3, } }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { HasVideo = true, HasStoryboard = true, diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapListingSearchControl.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapListingSearchControl.cs index 008d91f649..a9fe7ed7d8 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapListingSearchControl.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapListingSearchControl.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; using osu.Game.Overlays.BeatmapListing; using osuTK; @@ -111,7 +112,7 @@ namespace osu.Game.Tests.Visual.UserInterface private static readonly BeatmapSetInfo beatmap_set = new BeatmapSetInfo { - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Covers = new BeatmapSetOnlineCovers { @@ -122,7 +123,7 @@ namespace osu.Game.Tests.Visual.UserInterface private static readonly BeatmapSetInfo no_cover_beatmap_set = new BeatmapSetInfo { - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Covers = new BeatmapSetOnlineCovers { diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneDashboardBeatmapListing.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneDashboardBeatmapListing.cs index c51204eaba..6727c7560b 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneDashboardBeatmapListing.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneDashboardBeatmapListing.cs @@ -11,6 +11,7 @@ using osu.Game.Users; using System; using osu.Framework.Graphics.Shapes; using System.Collections.Generic; +using osu.Game.Online.API.Requests.Responses; namespace osu.Game.Tests.Visual.UserInterface { @@ -69,7 +70,7 @@ namespace osu.Game.Tests.Visual.UserInterface Id = 100 } }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Covers = new BeatmapSetOnlineCovers { @@ -90,7 +91,7 @@ namespace osu.Game.Tests.Visual.UserInterface Id = 100 } }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Covers = new BeatmapSetOnlineCovers { @@ -115,7 +116,7 @@ namespace osu.Game.Tests.Visual.UserInterface Id = 100 } }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Covers = new BeatmapSetOnlineCovers { @@ -136,7 +137,7 @@ namespace osu.Game.Tests.Visual.UserInterface Id = 100 } }, - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Covers = new BeatmapSetOnlineCovers { diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneUpdateableBeatmapSetCover.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneUpdateableBeatmapSetCover.cs index 4fef93e291..3ac3002713 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneUpdateableBeatmapSetCover.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneUpdateableBeatmapSetCover.cs @@ -13,6 +13,7 @@ using osu.Framework.Testing; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics.Containers; +using osu.Game.Online.API.Requests.Responses; using osuTK; namespace osu.Game.Tests.Visual.UserInterface @@ -22,21 +23,21 @@ namespace osu.Game.Tests.Visual.UserInterface [Test] public void TestLocal([Values] BeatmapSetCoverType coverType) { - AddStep("setup cover", () => Child = new UpdateableBeatmapSetCover(coverType) + AddStep("setup cover", () => Child = new UpdateableOnlineBeatmapSetCover(coverType) { BeatmapSet = CreateBeatmap(Ruleset.Value).BeatmapInfo.BeatmapSet, RelativeSizeAxes = Axes.Both, Masking = true, }); - AddUntilStep("wait for load", () => this.ChildrenOfType().SingleOrDefault()?.IsLoaded ?? false); + AddUntilStep("wait for load", () => this.ChildrenOfType().SingleOrDefault()?.IsLoaded ?? false); } [Test] public void TestUnloadAndReload() { OsuScrollContainer scroll = null; - List covers = new List(); + List covers = new List(); AddStep("setup covers", () => { @@ -65,7 +66,7 @@ namespace osu.Game.Tests.Visual.UserInterface { var coverType = coverTypes[i % coverTypes.Count]; - var cover = new UpdateableBeatmapSetCover(coverType) + var cover = new UpdateableOnlineBeatmapSetCover(coverType) { BeatmapSet = setInfo, Height = 100, @@ -84,7 +85,7 @@ namespace osu.Game.Tests.Visual.UserInterface } }); - var loadedCovers = covers.Where(c => c.ChildrenOfType().SingleOrDefault()?.IsLoaded ?? false); + var loadedCovers = covers.Where(c => c.ChildrenOfType().SingleOrDefault()?.IsLoaded ?? false); AddUntilStep("some loaded", () => loadedCovers.Any()); AddStep("scroll to end", () => scroll.ScrollToEnd()); @@ -94,9 +95,9 @@ namespace osu.Game.Tests.Visual.UserInterface [Test] public void TestSetNullBeatmapWhileLoading() { - TestUpdateableBeatmapSetCover updateableCover = null; + TestUpdateableOnlineBeatmapSetCover updateableCover = null; - AddStep("setup cover", () => Child = updateableCover = new TestUpdateableBeatmapSetCover + AddStep("setup cover", () => Child = updateableCover = new TestUpdateableOnlineBeatmapSetCover { BeatmapSet = CreateBeatmap(Ruleset.Value).BeatmapInfo.BeatmapSet, RelativeSizeAxes = Axes.Both, @@ -111,10 +112,10 @@ namespace osu.Game.Tests.Visual.UserInterface [Test] public void TestCoverChangeOnNewBeatmap() { - TestUpdateableBeatmapSetCover updateableCover = null; - BeatmapSetCover initialCover = null; + TestUpdateableOnlineBeatmapSetCover updateableCover = null; + OnlineBeatmapSetCover initialCover = null; - AddStep("setup cover", () => Child = updateableCover = new TestUpdateableBeatmapSetCover(0) + AddStep("setup cover", () => Child = updateableCover = new TestUpdateableOnlineBeatmapSetCover(0) { BeatmapSet = createBeatmapWithCover("https://assets.ppy.sh/beatmaps/1189904/covers/cover.jpg"), RelativeSizeAxes = Axes.Both, @@ -122,38 +123,38 @@ namespace osu.Game.Tests.Visual.UserInterface Alpha = 0.4f }); - AddUntilStep("cover loaded", () => updateableCover.ChildrenOfType().Any()); - AddStep("store initial cover", () => initialCover = updateableCover.ChildrenOfType().Single()); + AddUntilStep("cover loaded", () => updateableCover.ChildrenOfType().Any()); + AddStep("store initial cover", () => initialCover = updateableCover.ChildrenOfType().Single()); AddUntilStep("wait for fade complete", () => initialCover.Alpha == 1); AddStep("switch beatmap", () => updateableCover.BeatmapSet = createBeatmapWithCover("https://assets.ppy.sh/beatmaps/1079428/covers/cover.jpg")); - AddUntilStep("new cover loaded", () => updateableCover.ChildrenOfType().Except(new[] { initialCover }).Any()); + AddUntilStep("new cover loaded", () => updateableCover.ChildrenOfType().Except(new[] { initialCover }).Any()); } private static BeatmapSetInfo createBeatmapWithCover(string coverUrl) => new BeatmapSetInfo { - OnlineInfo = new BeatmapSetOnlineInfo + OnlineInfo = new APIBeatmapSet { Covers = new BeatmapSetOnlineCovers { Cover = coverUrl } } }; - private class TestUpdateableBeatmapSetCover : UpdateableBeatmapSetCover + private class TestUpdateableOnlineBeatmapSetCover : UpdateableOnlineBeatmapSetCover { private readonly int loadDelay; - public TestUpdateableBeatmapSetCover(int loadDelay = 10000) + public TestUpdateableOnlineBeatmapSetCover(int loadDelay = 10000) { this.loadDelay = loadDelay; } - protected override Drawable CreateDrawable(BeatmapSetInfo model) + protected override Drawable CreateDrawable(IBeatmapSetOnlineInfo model) { if (model == null) return null; - return new TestBeatmapSetCover(model, loadDelay) + return new TestOnlineBeatmapSetCover(model, loadDelay) { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -163,11 +164,11 @@ namespace osu.Game.Tests.Visual.UserInterface } } - private class TestBeatmapSetCover : BeatmapSetCover + private class TestOnlineBeatmapSetCover : OnlineBeatmapSetCover { private readonly int loadDelay; - public TestBeatmapSetCover(BeatmapSetInfo set, int loadDelay) + public TestOnlineBeatmapSetCover(IBeatmapSetOnlineInfo set, int loadDelay) : base(set) { this.loadDelay = loadDelay; diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 0e5a66e7fe..be29566e07 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Textures; -using osu.Framework.Localisation; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; @@ -21,7 +20,8 @@ namespace osu.Game.Tournament.Components { public class TournamentBeatmapPanel : CompositeDrawable { - public readonly BeatmapInfo BeatmapInfo; + public readonly IBeatmapInfo BeatmapInfo; + private readonly string mod; private const float horizontal_padding = 10; @@ -32,12 +32,13 @@ namespace osu.Game.Tournament.Components private readonly Bindable currentMatch = new Bindable(); private Box flash; - public TournamentBeatmapPanel(BeatmapInfo beatmapInfo, string mod = null) + public TournamentBeatmapPanel(IBeatmapInfo beatmapInfo, string mod = null) { if (beatmapInfo == null) throw new ArgumentNullException(nameof(beatmapInfo)); BeatmapInfo = beatmapInfo; this.mod = mod; + Width = 400; Height = HEIGHT; } @@ -57,11 +58,11 @@ namespace osu.Game.Tournament.Components RelativeSizeAxes = Axes.Both, Colour = Color4.Black, }, - new UpdateableBeatmapSetCover + new UpdateableOnlineBeatmapSetCover { RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.5f), - BeatmapSet = BeatmapInfo.BeatmapSet, + BeatmapSet = BeatmapInfo.BeatmapSet as IBeatmapSetOnlineInfo, }, new FillFlowContainer { @@ -74,9 +75,7 @@ namespace osu.Game.Tournament.Components { new TournamentSpriteText { - Text = new RomanisableString( - $"{BeatmapInfo.Metadata.ArtistUnicode ?? BeatmapInfo.Metadata.Artist} - {BeatmapInfo.Metadata.TitleUnicode ?? BeatmapInfo.Metadata.Title}", - $"{BeatmapInfo.Metadata.Artist} - {BeatmapInfo.Metadata.Title}"), + Text = BeatmapInfo.GetDisplayTitleRomanisable(false), Font = OsuFont.Torus.With(weight: FontWeight.Bold), }, new FillFlowContainer @@ -93,7 +92,7 @@ namespace osu.Game.Tournament.Components }, new TournamentSpriteText { - Text = BeatmapInfo.Metadata.AuthorString, + Text = BeatmapInfo.Metadata?.Author, Padding = new MarginPadding { Right = 20 }, Font = OsuFont.Torus.With(weight: FontWeight.Bold, size: 14) }, @@ -105,7 +104,7 @@ namespace osu.Game.Tournament.Components }, new TournamentSpriteText { - Text = BeatmapInfo.Version, + Text = BeatmapInfo.DifficultyName, Font = OsuFont.Torus.With(weight: FontWeight.Bold, size: 14) }, } @@ -149,7 +148,7 @@ namespace osu.Game.Tournament.Components private void updateState() { - var found = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == BeatmapInfo.OnlineBeatmapID); + var found = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == BeatmapInfo.OnlineID); bool doFlash = found != choice; choice = found; diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 1e3c550323..5f6546c303 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -147,11 +147,11 @@ namespace osu.Game.Tournament.Screens.MapPool if (map != null) { - if (e.Button == MouseButton.Left && map.BeatmapInfo.OnlineBeatmapID != null) - addForBeatmap(map.BeatmapInfo.OnlineBeatmapID.Value); + if (e.Button == MouseButton.Left && map.BeatmapInfo.OnlineID > 0) + addForBeatmap(map.BeatmapInfo.OnlineID); else { - var existing = CurrentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == map.BeatmapInfo.OnlineBeatmapID); + var existing = CurrentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == map.BeatmapInfo.OnlineID); if (existing != null) { diff --git a/osu.Game/Beatmaps/BeatmapInfoExtensions.cs b/osu.Game/Beatmaps/BeatmapInfoExtensions.cs index eba19ac1a1..836302c424 100644 --- a/osu.Game/Beatmaps/BeatmapInfoExtensions.cs +++ b/osu.Game/Beatmaps/BeatmapInfoExtensions.cs @@ -16,12 +16,17 @@ namespace osu.Game.Beatmaps /// /// A user-presentable display title representing this beatmap, with localisation handling for potentially romanisable fields. /// - public static RomanisableString GetDisplayTitleRomanisable(this IBeatmapInfo beatmapInfo) + public static RomanisableString GetDisplayTitleRomanisable(this IBeatmapInfo beatmapInfo, bool includeDifficultyName = true) { var metadata = getClosestMetadata(beatmapInfo).GetDisplayTitleRomanisable(); - var versionString = getVersionString(beatmapInfo); - return new RomanisableString($"{metadata.GetPreferred(true)} {versionString}".Trim(), $"{metadata.GetPreferred(false)} {versionString}".Trim()); + if (includeDifficultyName) + { + var versionString = getVersionString(beatmapInfo); + return new RomanisableString($"{metadata.GetPreferred(true)} {versionString}".Trim(), $"{metadata.GetPreferred(false)} {versionString}".Trim()); + } + + return new RomanisableString($"{metadata.GetPreferred(true)}".Trim(), $"{metadata.GetPreferred(false)}".Trim()); } public static string[] GetSearchableTerms(this IBeatmapInfo beatmapInfo) => new[] diff --git a/osu.Game/Beatmaps/BeatmapSetInfo.cs b/osu.Game/Beatmaps/BeatmapSetInfo.cs index e8c77e792f..c3e2399d53 100644 --- a/osu.Game/Beatmaps/BeatmapSetInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetInfo.cs @@ -6,13 +6,15 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using JetBrains.Annotations; +using Newtonsoft.Json; using osu.Framework.Testing; using osu.Game.Database; +using osu.Game.Online.API.Requests.Responses; namespace osu.Game.Beatmaps { [ExcludeFromDynamicCompile] - public class BeatmapSetInfo : IHasPrimaryKey, IHasFiles, ISoftDelete, IEquatable, IBeatmapSetInfo + public class BeatmapSetInfo : IHasPrimaryKey, IHasFiles, ISoftDelete, IEquatable, IBeatmapSetInfo, IBeatmapSetOnlineInfo { public int ID { get; set; } @@ -26,8 +28,6 @@ namespace osu.Game.Beatmaps public DateTimeOffset DateAdded { get; set; } - public BeatmapSetOnlineStatus Status { get; set; } = BeatmapSetOnlineStatus.None; - public BeatmapMetadata Metadata { get; set; } public List Beatmaps { get; set; } @@ -36,7 +36,7 @@ namespace osu.Game.Beatmaps public List Files { get; set; } = new List(); [NotMapped] - public BeatmapSetOnlineInfo OnlineInfo { get; set; } + public APIBeatmapSet OnlineInfo { get; set; } [NotMapped] public BeatmapSetMetrics Metrics { get; set; } @@ -102,5 +102,141 @@ namespace osu.Game.Beatmaps IEnumerable IBeatmapSetInfo.Files => Files; #endregion + + #region Delegation for IBeatmapSetOnlineInfo + + [NotMapped] + [JsonIgnore] + public DateTimeOffset Submitted + { + get => OnlineInfo.Submitted; + set => OnlineInfo.Submitted = value; + } + + [NotMapped] + [JsonIgnore] + public DateTimeOffset? Ranked + { + get => OnlineInfo.Ranked; + set => OnlineInfo.Ranked = value; + } + + [NotMapped] + [JsonIgnore] + public DateTimeOffset? LastUpdated + { + get => OnlineInfo.LastUpdated; + set => OnlineInfo.LastUpdated = value; + } + + [NotMapped] + [JsonIgnore] + public BeatmapSetOnlineStatus Status { get; set; } = BeatmapSetOnlineStatus.None; + + [NotMapped] + [JsonIgnore] + public bool HasExplicitContent + { + get => OnlineInfo.HasExplicitContent; + set => OnlineInfo.HasExplicitContent = value; + } + + [NotMapped] + [JsonIgnore] + public bool HasVideo + { + get => OnlineInfo.HasVideo; + set => OnlineInfo.HasVideo = value; + } + + [NotMapped] + [JsonIgnore] + public bool HasStoryboard + { + get => OnlineInfo.HasStoryboard; + set => OnlineInfo.HasStoryboard = value; + } + + [NotMapped] + [JsonIgnore] + public BeatmapSetOnlineCovers Covers + { + get => OnlineInfo.Covers; + set => OnlineInfo.Covers = value; + } + + [NotMapped] + [JsonIgnore] + public string Preview + { + get => OnlineInfo.Preview; + set => OnlineInfo.Preview = value; + } + + [NotMapped] + [JsonIgnore] + public double BPM + { + get => OnlineInfo.BPM; + set => OnlineInfo.BPM = value; + } + + [NotMapped] + [JsonIgnore] + public int PlayCount + { + get => OnlineInfo.PlayCount; + set => OnlineInfo.PlayCount = value; + } + + [NotMapped] + [JsonIgnore] + public int FavouriteCount + { + get => OnlineInfo.FavouriteCount; + set => OnlineInfo.FavouriteCount = value; + } + + [NotMapped] + [JsonIgnore] + public bool HasFavourited + { + get => OnlineInfo.HasFavourited; + set => OnlineInfo.HasFavourited = value; + } + + [NotMapped] + [JsonIgnore] + public BeatmapSetOnlineAvailability Availability + { + get => OnlineInfo.Availability; + set => OnlineInfo.Availability = value; + } + + [NotMapped] + [JsonIgnore] + public BeatmapSetOnlineGenre Genre + { + get => OnlineInfo.Genre; + set => OnlineInfo.Genre = value; + } + + [NotMapped] + [JsonIgnore] + public BeatmapSetOnlineLanguage Language + { + get => OnlineInfo.Language; + set => OnlineInfo.Language = value; + } + + [NotMapped] + [JsonIgnore] + public int? TrackId + { + get => OnlineInfo.TrackId; + set => OnlineInfo.TrackId = value; + } + + #endregion } } diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineAvailability.cs b/osu.Game/Beatmaps/BeatmapSetOnlineAvailability.cs new file mode 100644 index 0000000000..8c67aa2404 --- /dev/null +++ b/osu.Game/Beatmaps/BeatmapSetOnlineAvailability.cs @@ -0,0 +1,16 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using Newtonsoft.Json; + +namespace osu.Game.Beatmaps +{ + public class BeatmapSetOnlineAvailability + { + [JsonProperty(@"download_disabled")] + public bool DownloadDisabled { get; set; } + + [JsonProperty(@"more_information")] + public string ExternalLink { get; set; } + } +} diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineCovers.cs b/osu.Game/Beatmaps/BeatmapSetOnlineCovers.cs new file mode 100644 index 0000000000..8d6e85391d --- /dev/null +++ b/osu.Game/Beatmaps/BeatmapSetOnlineCovers.cs @@ -0,0 +1,25 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using Newtonsoft.Json; + +namespace osu.Game.Beatmaps +{ + public class BeatmapSetOnlineCovers + { + public string CoverLowRes { get; set; } + + [JsonProperty(@"cover@2x")] + public string Cover { get; set; } + + public string CardLowRes { get; set; } + + [JsonProperty(@"card@2x")] + public string Card { get; set; } + + public string ListLowRes { get; set; } + + [JsonProperty(@"list@2x")] + public string List { get; set; } + } +} diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineGenre.cs b/osu.Game/Beatmaps/BeatmapSetOnlineGenre.cs new file mode 100644 index 0000000000..65d6dfe5d9 --- /dev/null +++ b/osu.Game/Beatmaps/BeatmapSetOnlineGenre.cs @@ -0,0 +1,11 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Beatmaps +{ + public class 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 new file mode 100644 index 0000000000..057325f319 --- /dev/null +++ b/osu.Game/Beatmaps/BeatmapSetOnlineLanguage.cs @@ -0,0 +1,11 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Beatmaps +{ + public class BeatmapSetOnlineLanguage + { + public int Id { get; set; } + public string Name { get; set; } + } +} diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs b/osu.Game/Beatmaps/Drawables/OnlineBeatmapSetCover.cs similarity index 76% rename from osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs rename to osu.Game/Beatmaps/Drawables/OnlineBeatmapSetCover.cs index 5245bc319d..0b19c27022 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs +++ b/osu.Game/Beatmaps/Drawables/OnlineBeatmapSetCover.cs @@ -9,12 +9,12 @@ using osu.Framework.Graphics.Textures; namespace osu.Game.Beatmaps.Drawables { [LongRunningLoad] - public class BeatmapSetCover : Sprite + public class OnlineBeatmapSetCover : Sprite { - private readonly BeatmapSetInfo set; + private readonly IBeatmapSetOnlineInfo set; private readonly BeatmapSetCoverType type; - public BeatmapSetCover(BeatmapSetInfo set, BeatmapSetCoverType type = BeatmapSetCoverType.Cover) + public OnlineBeatmapSetCover(IBeatmapSetOnlineInfo set, BeatmapSetCoverType type = BeatmapSetCoverType.Cover) { if (set == null) throw new ArgumentNullException(nameof(set)); @@ -31,15 +31,15 @@ namespace osu.Game.Beatmaps.Drawables switch (type) { case BeatmapSetCoverType.Cover: - resource = set.OnlineInfo.Covers.Cover; + resource = set.Covers.Cover; break; case BeatmapSetCoverType.Card: - resource = set.OnlineInfo.Covers.Card; + resource = set.Covers.Card; break; case BeatmapSetCoverType.List: - resource = set.OnlineInfo.Covers.List; + resource = set.Covers.List; break; } diff --git a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs b/osu.Game/Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs index 3206f7b3ab..8943ad350e 100644 --- a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs +++ b/osu.Game/Beatmaps/Drawables/UpdateableBeatmapBackgroundSprite.cs @@ -54,7 +54,7 @@ namespace osu.Game.Beatmaps.Drawables { // prefer online cover where available. if (model?.BeatmapSet?.OnlineInfo != null) - return new BeatmapSetCover(model.BeatmapSet, beatmapSetCoverType); + return new OnlineBeatmapSetCover(model.BeatmapSet, beatmapSetCoverType); return model?.ID > 0 ? new BeatmapBackgroundSprite(beatmaps.GetWorkingBeatmap(model)) diff --git a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs b/osu.Game/Beatmaps/Drawables/UpdateableOnlineBeatmapSetCover.cs similarity index 78% rename from osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs rename to osu.Game/Beatmaps/Drawables/UpdateableOnlineBeatmapSetCover.cs index 7248c9213c..73f87beb58 100644 --- a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs +++ b/osu.Game/Beatmaps/Drawables/UpdateableOnlineBeatmapSetCover.cs @@ -9,11 +9,11 @@ using osu.Game.Graphics; namespace osu.Game.Beatmaps.Drawables { - public class UpdateableBeatmapSetCover : ModelBackedDrawable + public class UpdateableOnlineBeatmapSetCover : ModelBackedDrawable { private readonly BeatmapSetCoverType coverType; - public BeatmapSetInfo BeatmapSet + public IBeatmapSetOnlineInfo BeatmapSet { get => Model; set => Model = value; @@ -25,7 +25,7 @@ namespace osu.Game.Beatmaps.Drawables set => base.Masking = value; } - public UpdateableBeatmapSetCover(BeatmapSetCoverType coverType = BeatmapSetCoverType.Cover) + public UpdateableOnlineBeatmapSetCover(BeatmapSetCoverType coverType = BeatmapSetCoverType.Cover) { this.coverType = coverType; @@ -43,12 +43,12 @@ namespace osu.Game.Beatmaps.Drawables protected override DelayedLoadWrapper CreateDelayedLoadWrapper(Func createContentFunc, double timeBeforeLoad) => new DelayedLoadUnloadWrapper(createContentFunc, timeBeforeLoad); - protected override Drawable CreateDrawable(BeatmapSetInfo model) + protected override Drawable CreateDrawable(IBeatmapSetOnlineInfo model) { if (model == null) return null; - return new BeatmapSetCover(model, coverType) + return new OnlineBeatmapSetCover(model, coverType) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs b/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs similarity index 52% rename from osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs rename to osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs index 3658dbab83..f365a59c1b 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs +++ b/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs @@ -1,139 +1,99 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; -using Newtonsoft.Json; namespace osu.Game.Beatmaps { /// /// Beatmap set info retrieved for previewing locally without having the set downloaded. /// - public class BeatmapSetOnlineInfo + public interface IBeatmapSetOnlineInfo { /// /// The date this beatmap set was submitted to the online listing. /// - public DateTimeOffset Submitted { get; set; } + DateTimeOffset Submitted { get; set; } /// /// The date this beatmap set was ranked. /// - public DateTimeOffset? Ranked { get; set; } + DateTimeOffset? Ranked { get; set; } /// /// The date this beatmap set was last updated. /// - public DateTimeOffset? LastUpdated { get; set; } + DateTimeOffset? LastUpdated { get; set; } /// /// The status of this beatmap set. /// - public BeatmapSetOnlineStatus Status { get; set; } + BeatmapSetOnlineStatus Status { get; set; } /// /// Whether or not this beatmap set has explicit content. /// - public bool HasExplicitContent { get; set; } + bool HasExplicitContent { get; set; } /// /// Whether or not this beatmap set has a background video. /// - public bool HasVideo { get; set; } + bool HasVideo { get; set; } /// /// Whether or not this beatmap set has a storyboard. /// - public bool HasStoryboard { get; set; } + bool HasStoryboard { get; set; } /// /// The different sizes of cover art for this beatmap set. /// - public BeatmapSetOnlineCovers Covers { get; set; } + BeatmapSetOnlineCovers Covers { get; set; } /// /// A small sample clip of this beatmap set's song. /// - public string Preview { get; set; } + string Preview { get; set; } /// /// The beats per minute of this beatmap set's song. /// - public double BPM { get; set; } + double BPM { get; set; } /// /// The amount of plays this beatmap set has. /// - public int PlayCount { get; set; } + int PlayCount { get; set; } /// /// The amount of people who have favourited this beatmap set. /// - public int FavouriteCount { get; set; } + int FavouriteCount { get; set; } /// /// Whether this beatmap set has been favourited by the current user. /// - public bool HasFavourited { get; set; } + bool HasFavourited { get; set; } /// /// The availability of this beatmap set. /// - public BeatmapSetOnlineAvailability Availability { get; set; } + BeatmapSetOnlineAvailability Availability { get; set; } /// /// The song genre of this beatmap set. /// - public BeatmapSetOnlineGenre Genre { get; set; } + BeatmapSetOnlineGenre Genre { get; set; } /// /// The song language of this beatmap set. /// - public BeatmapSetOnlineLanguage Language { get; set; } + BeatmapSetOnlineLanguage Language { get; set; } /// /// The track ID of this beatmap set. /// Non-null only if the track is linked to a featured artist track entry. /// - public int? TrackId { get; set; } - } - - public class BeatmapSetOnlineGenre - { - public int Id { get; set; } - public string Name { get; set; } - } - - public class BeatmapSetOnlineLanguage - { - public int Id { get; set; } - public string Name { get; set; } - } - - public class BeatmapSetOnlineCovers - { - public string CoverLowRes { get; set; } - - [JsonProperty(@"cover@2x")] - public string Cover { get; set; } - - public string CardLowRes { get; set; } - - [JsonProperty(@"card@2x")] - public string Card { get; set; } - - public string ListLowRes { get; set; } - - [JsonProperty(@"list@2x")] - public string List { get; set; } - } - - public class BeatmapSetOnlineAvailability - { - [JsonProperty(@"download_disabled")] - public bool DownloadDisabled { get; set; } - - [JsonProperty(@"more_information")] - public string ExternalLink { get; set; } + int? TrackId { get; set; } } } diff --git a/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs b/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs index 35963792d0..25d69c2797 100644 --- a/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs +++ b/osu.Game/Online/API/Requests/Responses/APIBeatmapSet.cs @@ -10,10 +10,10 @@ using osu.Game.Rulesets; namespace osu.Game.Online.API.Requests.Responses { - public class APIBeatmapSet : BeatmapMetadata // todo: this is a bit wrong... + public class APIBeatmapSet : BeatmapMetadata, IBeatmapSetOnlineInfo { [JsonProperty(@"covers")] - private BeatmapSetOnlineCovers covers { get; set; } + public BeatmapSetOnlineCovers Covers { get; set; } private int? onlineBeatmapSetID; @@ -28,43 +28,43 @@ namespace osu.Game.Online.API.Requests.Responses public BeatmapSetOnlineStatus Status { get; set; } [JsonProperty(@"preview_url")] - private string preview { get; set; } + public string Preview { get; set; } [JsonProperty(@"has_favourited")] - private bool hasFavourited { get; set; } + public bool HasFavourited { get; set; } [JsonProperty(@"play_count")] - private int playCount { get; set; } + public int PlayCount { get; set; } [JsonProperty(@"favourite_count")] - private int favouriteCount { get; set; } + public int FavouriteCount { get; set; } [JsonProperty(@"bpm")] - private double bpm { get; set; } + public double BPM { get; set; } [JsonProperty(@"nsfw")] - private bool hasExplicitContent { get; set; } + public bool HasExplicitContent { get; set; } [JsonProperty(@"video")] - private bool hasVideo { get; set; } + public bool HasVideo { get; set; } [JsonProperty(@"storyboard")] - private bool hasStoryboard { get; set; } + public bool HasStoryboard { get; set; } [JsonProperty(@"submitted_date")] - private DateTimeOffset submitted { get; set; } + public DateTimeOffset Submitted { get; set; } [JsonProperty(@"ranked_date")] - private DateTimeOffset? ranked { get; set; } + public DateTimeOffset? Ranked { get; set; } [JsonProperty(@"last_updated")] - private DateTimeOffset lastUpdated { get; set; } + public DateTimeOffset? LastUpdated { get; set; } [JsonProperty(@"ratings")] private int[] ratings { get; set; } [JsonProperty(@"track_id")] - private int? trackId { get; set; } + public int? TrackId { get; set; } [JsonProperty(@"user_id")] private int creatorId @@ -73,13 +73,13 @@ namespace osu.Game.Online.API.Requests.Responses } [JsonProperty(@"availability")] - private BeatmapSetOnlineAvailability availability { get; set; } + public BeatmapSetOnlineAvailability Availability { get; set; } [JsonProperty(@"genre")] - private BeatmapSetOnlineGenre genre { get; set; } + public BeatmapSetOnlineGenre Genre { get; set; } [JsonProperty(@"language")] - private BeatmapSetOnlineLanguage language { get; set; } + public BeatmapSetOnlineLanguage Language { get; set; } [JsonProperty(@"beatmaps")] private IEnumerable beatmaps { get; set; } @@ -92,26 +92,7 @@ namespace osu.Game.Online.API.Requests.Responses Metadata = this, Status = Status, Metrics = ratings == null ? null : new BeatmapSetMetrics { Ratings = ratings }, - OnlineInfo = new BeatmapSetOnlineInfo - { - Covers = covers, - Preview = preview, - PlayCount = playCount, - FavouriteCount = favouriteCount, - BPM = bpm, - Status = Status, - HasExplicitContent = hasExplicitContent, - HasVideo = hasVideo, - HasStoryboard = hasStoryboard, - Submitted = submitted, - Ranked = ranked, - LastUpdated = lastUpdated, - Availability = availability, - HasFavourited = hasFavourited, - Genre = genre, - Language = language, - TrackId = trackId - }, + OnlineInfo = this }; beatmapSet.Beatmaps = beatmaps?.Select(b => diff --git a/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs b/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs index 86879ba245..52aa115083 100644 --- a/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs +++ b/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs @@ -59,7 +59,7 @@ namespace osu.Game.Online.Rooms protected override bool VerifyDatabasedModel(BeatmapSetInfo databasedSet) { - int? beatmapId = SelectedItem.Value?.Beatmap.Value.OnlineBeatmapID; + int beatmapId = SelectedItem.Value?.Beatmap.Value.OnlineID ?? -1; string checksum = SelectedItem.Value?.Beatmap.Value.MD5Hash; var matchingBeatmap = databasedSet.Beatmaps.FirstOrDefault(b => b.OnlineBeatmapID == beatmapId && b.MD5Hash == checksum); @@ -75,10 +75,10 @@ namespace osu.Game.Online.Rooms protected override bool IsModelAvailableLocally() { - int? beatmapId = SelectedItem.Value.Beatmap.Value.OnlineBeatmapID; + int onlineId = SelectedItem.Value.Beatmap.Value.OnlineID; string checksum = SelectedItem.Value.Beatmap.Value.MD5Hash; - var beatmap = Manager.QueryBeatmap(b => b.OnlineBeatmapID == beatmapId && b.MD5Hash == checksum); + var beatmap = Manager.QueryBeatmap(b => b.OnlineBeatmapID == onlineId && b.MD5Hash == checksum); return beatmap?.BeatmapSet.DeletePending == false; } diff --git a/osu.Game/Overlays/BeatmapListing/BeatmapListingSearchControl.cs b/osu.Game/Overlays/BeatmapListing/BeatmapListingSearchControl.cs index bbde03aa10..da2dcfebdf 100644 --- a/osu.Game/Overlays/BeatmapListing/BeatmapListingSearchControl.cs +++ b/osu.Game/Overlays/BeatmapListing/BeatmapListingSearchControl.cs @@ -76,7 +76,7 @@ namespace osu.Game.Overlays.BeatmapListing private readonly BeatmapSearchFilterRow explicitContentFilter; private readonly Box background; - private readonly UpdateableBeatmapSetCover beatmapCover; + private readonly UpdateableOnlineBeatmapSetCover beatmapCover; public BeatmapListingSearchControl() { @@ -196,7 +196,7 @@ namespace osu.Game.Overlays.BeatmapListing } } - private class TopSearchBeatmapSetCover : UpdateableBeatmapSetCover + private class TopSearchBeatmapSetCover : UpdateableOnlineBeatmapSetCover { protected override bool TransformImmediately => true; } diff --git a/osu.Game/Overlays/BeatmapListing/Panels/BeatmapPanel.cs b/osu.Game/Overlays/BeatmapListing/Panels/BeatmapPanel.cs index 9ff39ce1dd..779f3860f2 100644 --- a/osu.Game/Overlays/BeatmapListing/Panels/BeatmapPanel.cs +++ b/osu.Game/Overlays/BeatmapListing/Panels/BeatmapPanel.cs @@ -160,7 +160,7 @@ namespace osu.Game.Overlays.BeatmapListing.Panels return icons; } - protected Drawable CreateBackground() => new UpdateableBeatmapSetCover + protected Drawable CreateBackground() => new UpdateableOnlineBeatmapSetCover { RelativeSizeAxes = Axes.Both, BeatmapSet = SetInfo, diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapSetHeaderContent.cs b/osu.Game/Overlays/BeatmapSet/BeatmapSetHeaderContent.cs index dcf06ac7fb..fc2f90807e 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapSetHeaderContent.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapSetHeaderContent.cs @@ -32,7 +32,7 @@ namespace osu.Game.Overlays.BeatmapSet public readonly Details Details; public readonly BeatmapPicker Picker; - private readonly UpdateableBeatmapSetCover cover; + private readonly UpdateableOnlineBeatmapSetCover cover; private readonly Box coverGradient; private readonly OsuSpriteText title, artist; private readonly AuthorInfo author; @@ -68,7 +68,7 @@ namespace osu.Game.Overlays.BeatmapSet RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - cover = new UpdateableBeatmapSetCover + cover = new UpdateableOnlineBeatmapSetCover { RelativeSizeAxes = Axes.Both, Masking = true, diff --git a/osu.Game/Overlays/Dashboard/Home/DashboardBeatmapPanel.cs b/osu.Game/Overlays/Dashboard/Home/DashboardBeatmapPanel.cs index 3badea155d..edc737d8fe 100644 --- a/osu.Game/Overlays/Dashboard/Home/DashboardBeatmapPanel.cs +++ b/osu.Game/Overlays/Dashboard/Home/DashboardBeatmapPanel.cs @@ -77,7 +77,7 @@ namespace osu.Game.Overlays.Dashboard.Home RelativeSizeAxes = Axes.Both, Masking = true, CornerRadius = 6, - Child = new UpdateableBeatmapSetCover + Child = new UpdateableOnlineBeatmapSetCover { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, diff --git a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs index 2c6fa76ca4..32201e36a9 100644 --- a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs +++ b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs @@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Profile.Sections.Historical { AddRangeInternal(new Drawable[] { - new UpdateableBeatmapSetCover(BeatmapSetCoverType.List) + new UpdateableOnlineBeatmapSetCover(BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Y, Width = cover_width, diff --git a/osu.Game/Screens/OnlinePlay/Components/BeatmapTitle.cs b/osu.Game/Screens/OnlinePlay/Components/BeatmapTitle.cs index e5a5e35897..2901758332 100644 --- a/osu.Game/Screens/OnlinePlay/Components/BeatmapTitle.cs +++ b/osu.Game/Screens/OnlinePlay/Components/BeatmapTitle.cs @@ -86,7 +86,7 @@ namespace osu.Game.Screens.OnlinePlay.Components Text = new RomanisableString(beatmap.Value.Metadata.TitleUnicode, beatmap.Value.Metadata.Title), Font = OsuFont.GetFont(size: TextSize), } - }, LinkAction.OpenBeatmap, beatmap.Value.OnlineBeatmapID.ToString(), "Open beatmap"); + }, LinkAction.OpenBeatmap, beatmap.Value.OnlineID.ToString(), "Open beatmap"); } } } diff --git a/osu.Game/Tests/Beatmaps/TestBeatmap.cs b/osu.Game/Tests/Beatmaps/TestBeatmap.cs index 2717146c99..d8e72d31a7 100644 --- a/osu.Game/Tests/Beatmaps/TestBeatmap.cs +++ b/osu.Game/Tests/Beatmaps/TestBeatmap.cs @@ -8,6 +8,7 @@ using System.Text; using osu.Framework.Extensions; using osu.Game.Beatmaps; using osu.Game.IO; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Rulesets; using Decoder = osu.Game.Beatmaps.Formats.Decoder; @@ -32,7 +33,7 @@ namespace osu.Game.Tests.Beatmaps BeatmapInfo.BeatmapSet.Beatmaps = new List { BeatmapInfo }; BeatmapInfo.Length = 75000; BeatmapInfo.OnlineInfo = new BeatmapOnlineInfo(); - BeatmapInfo.BeatmapSet.OnlineInfo = new BeatmapSetOnlineInfo + BeatmapInfo.BeatmapSet.OnlineInfo = new APIBeatmapSet { Status = BeatmapSetOnlineStatus.Ranked, Covers = new BeatmapSetOnlineCovers