diff --git a/osu.Game/Online/API/Requests/GetBeatmapDetailsRequest.cs b/osu.Game/Online/API/Requests/GetBeatmapDetailsRequest.cs index 512938fcf4..593097f616 100644 --- a/osu.Game/Online/API/Requests/GetBeatmapDetailsRequest.cs +++ b/osu.Game/Online/API/Requests/GetBeatmapDetailsRequest.cs @@ -1,11 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using Newtonsoft.Json; using osu.Framework.IO.Network; using osu.Game.Database; -using osu.Game.Rulesets.Scoring; namespace osu.Game.Online.API.Requests { @@ -13,25 +11,13 @@ namespace osu.Game.Online.API.Requests { private readonly BeatmapInfo beatmap; - private string lookupString; + private string lookupString => beatmap.OnlineBeatmapID > 0 ? beatmap.OnlineBeatmapID.ToString() : $@"lookup?checksum={beatmap.Hash}&filename={beatmap.Path}"; public GetBeatmapDetailsRequest(BeatmapInfo beatmap) { this.beatmap = beatmap; } - protected override WebRequest CreateWebRequest() - { - if (beatmap.OnlineBeatmapID > 0) - lookupString = beatmap.OnlineBeatmapID.ToString(); - else - lookupString = $@"lookup?checksum={beatmap.Hash}&filename={beatmap.Path}"; - - var req = base.CreateWebRequest(); - - return req; - } - protected override string Target => $@"beatmaps/{lookupString}"; } @@ -43,8 +29,8 @@ namespace osu.Game.Online.API.Requests { set { - this.Fails = value.Fails; - this.Retries = value.Retries; + Fails = value.Fails; + Retries = value.Retries; } } @@ -54,7 +40,7 @@ namespace osu.Game.Online.API.Requests { set { - this.Ratings = value.Ratings; + Ratings = value.Ratings; } } } diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 32e5f2505e..d217fa66fe 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -17,7 +17,6 @@ using System.Linq; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Framework.Threading; -using System; namespace osu.Game.Screens.Select { @@ -83,9 +82,9 @@ namespace osu.Game.Screens.Select return; requestedBeatmap.Metrics = res; - Schedule(() => updateMetrics(res, true)); + Schedule(() => updateMetrics(res)); }; - lookup.Failure += e => updateMetrics(null, true); + lookup.Failure += e => updateMetrics(null); api.Queue(lookup); }