1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:35:35 +08:00

Return BPM back to OnlineInfo

Revert commit of "Move BPM out of OnlineInfo"
This commit is contained in:
iiSaLMaN 2019-07-08 09:10:41 +03:00
parent d874574612
commit 90d5484818
9 changed files with 19 additions and 13 deletions

View File

@ -96,11 +96,11 @@ namespace osu.Game.Tests.Visual.Online
FavouriteCount = 456,
Submitted = DateTime.Now,
Ranked = DateTime.Now,
BPM = 111,
HasVideo = true,
HasStoryboard = true,
Covers = new BeatmapSetOnlineCovers(),
},
BPM = 111,
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() },
Beatmaps = new List<BeatmapInfo>
{
@ -169,11 +169,11 @@ namespace osu.Game.Tests.Visual.Online
FavouriteCount = 456,
Submitted = DateTime.Now,
Ranked = DateTime.Now,
BPM = 111,
HasVideo = true,
HasStoryboard = true,
Covers = new BeatmapSetOnlineCovers(),
},
BPM = 111,
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() },
Beatmaps = new List<BeatmapInfo>
{

View File

@ -47,11 +47,11 @@ namespace osu.Game.Tests.Visual.Online
Preview = @"https://b.ppy.sh/preview/12345.mp3",
PlayCount = 123,
FavouriteCount = 456,
BPM = 111,
HasVideo = true,
HasStoryboard = true,
Covers = new BeatmapSetOnlineCovers(),
},
BPM = 111,
Beatmaps = new List<BeatmapInfo>
{
new BeatmapInfo

View File

@ -297,7 +297,10 @@ namespace osu.Game.Tests.Visual.SongSelect
},
Beatmaps = beatmaps,
DateAdded = DateTimeOffset.UtcNow,
BPM = bpm,
OnlineInfo = new BeatmapSetOnlineInfo
{
BPM = bpm,
}
};
}
}

View File

@ -272,7 +272,10 @@ namespace osu.Game.Beatmaps
Beatmaps = new List<BeatmapInfo>(),
Metadata = beatmap.Metadata,
DateAdded = DateTimeOffset.UtcNow,
BPM = beatmap.ControlPointInfo.BPMMode,
OnlineInfo = new BeatmapSetOnlineInfo
{
BPM = beatmap.ControlPointInfo.BPMMode,
}
};
}

View File

@ -35,11 +35,6 @@ namespace osu.Game.Beatmaps
[NotMapped]
public BeatmapSetMetrics Metrics { get; set; }
/// <summary>
/// The beats per minute of this beatmap set's song.
/// </summary>
public double BPM { get; set; }
public double MaxStarDifficulty => Beatmaps?.Max(b => b.StarDifficulty) ?? 0;
public double MaxLength => Beatmaps?.Max(b => b.Length) ?? 0;

View File

@ -51,6 +51,11 @@ namespace osu.Game.Beatmaps
/// </summary>
public string Preview { get; set; }
/// <summary>
/// The beats per minute of this beatmap set's song.
/// </summary>
public double BPM { get; set; }
/// <summary>
/// The amount of plays this beatmap set has.
/// </summary>

View File

@ -77,13 +77,13 @@ namespace osu.Game.Online.API.Requests.Responses
Metadata = this,
Status = Status,
Metrics = ratings == null ? null : new BeatmapSetMetrics { Ratings = ratings },
BPM = bpm,
OnlineInfo = new BeatmapSetOnlineInfo
{
Covers = covers,
Preview = preview,
PlayCount = playCount,
FavouriteCount = favouriteCount,
BPM = bpm,
Status = Status,
HasVideo = hasVideo,
HasStoryboard = hasStoryboard,

View File

@ -50,7 +50,7 @@ namespace osu.Game.Overlays.BeatmapSet
private void updateDisplay()
{
bpm.Value = BeatmapSet?.BPM.ToString(@"0.##") ?? "-";
bpm.Value = BeatmapSet?.OnlineInfo?.BPM.ToString(@"0.##") ?? "-";
if (beatmap == null)
{

View File

@ -49,7 +49,7 @@ namespace osu.Game.Screens.Select.Carousel
return otherSet.BeatmapSet.DateAdded.CompareTo(BeatmapSet.DateAdded);
case SortMode.BPM:
return BeatmapSet.BPM.CompareTo(otherSet.BeatmapSet.BPM);
return BeatmapSet.OnlineInfo.BPM.CompareTo(otherSet.BeatmapSet.OnlineInfo.BPM);
case SortMode.Length:
return BeatmapSet.MaxLength.CompareTo(otherSet.BeatmapSet.MaxLength);