From e73f22eff8844b3ee429764801c8b4164a194eb6 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Tue, 9 Jul 2019 17:53:34 +0300 Subject: [PATCH] Convert length retrieved from online to milliseconds --- osu.Game.Tournament/Components/SongBar.cs | 2 +- osu.Game/Beatmaps/BeatmapSetInfo.cs | 2 +- osu.Game/Online/API/Requests/Responses/APIBeatmap.cs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index ec021a8d1f..7005c068ae 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -180,7 +180,7 @@ namespace osu.Game.Tournament.Components panelContents.Children = new Drawable[] { - new DiffPiece(("Length", TimeSpan.FromSeconds(length).ToString(@"mm\:ss"))) + new DiffPiece(("Length", TimeSpan.FromMilliseconds(length).ToString(@"mm\:ss"))) { Anchor = Anchor.CentreLeft, Origin = Anchor.BottomLeft, diff --git a/osu.Game/Beatmaps/BeatmapSetInfo.cs b/osu.Game/Beatmaps/BeatmapSetInfo.cs index 4075263e12..03bc7c7312 100644 --- a/osu.Game/Beatmaps/BeatmapSetInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetInfo.cs @@ -41,7 +41,7 @@ namespace osu.Game.Beatmaps public double MaxStarDifficulty => Beatmaps?.Max(b => b.StarDifficulty) ?? 0; /// - /// The maximum playable length of all beatmaps in this set. + /// The maximum playable length in milliseconds of all beatmaps in this set. /// public double MaxLength => Beatmaps?.Max(b => b.Length) ?? 0; diff --git a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs index ff4d240bf0..f50e281dd0 100644 --- a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs +++ b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs @@ -1,6 +1,7 @@ // 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; using osu.Game.Beatmaps; using osu.Game.Rulesets; @@ -71,7 +72,7 @@ namespace osu.Game.Online.API.Requests.Responses StarDifficulty = starDifficulty, OnlineBeatmapID = OnlineBeatmapID, Version = version, - Length = length, + Length = TimeSpan.FromSeconds(length).Milliseconds, Status = Status, BeatmapSet = set, Metrics = metrics,