1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 02:23:18 +08:00

Merge pull request #2963 from peppy/fix-beatmap-links

Fix links from profile top scores to beatmaps not working correctly
This commit is contained in:
Dan Balasescu 2018-07-10 16:32:01 +09:00 committed by GitHub
commit 25813ddf22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -14,7 +14,6 @@ namespace osu.Game.Beatmaps
public class BeatmapMetadata : IEquatable<BeatmapMetadata>
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[JsonIgnore]
public int ID { get; set; }
public string Title { get; set; }

View File

@ -63,7 +63,14 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"beatmapset")]
private BeatmapMetadata metadata
{
set => Beatmap.Metadata = value;
set
{
// extract the set ID to its correct place.
Beatmap.BeatmapSet = new BeatmapSetInfo { OnlineBeatmapSetID = value.ID };
value.ID = 0;
Beatmap.Metadata = value;
}
}
[JsonProperty(@"statistics")]

View File

@ -9,6 +9,7 @@ using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Profile.Sections
{
/// <summary>
@ -32,7 +33,10 @@ namespace osu.Game.Overlays.Profile.Sections
{
Action = () =>
{
if (beatmap.BeatmapSet?.OnlineBeatmapSetID != null) beatmapSetOverlay?.FetchAndShowBeatmapSet(beatmap.BeatmapSet.OnlineBeatmapSetID.Value);
if (beatmap.OnlineBeatmapID != null)
beatmapSetOverlay?.FetchAndShowBeatmap(beatmap.OnlineBeatmapID.Value);
else if (beatmap.BeatmapSet?.OnlineBeatmapSetID != null)
beatmapSetOverlay?.FetchAndShowBeatmapSet(beatmap.BeatmapSet.OnlineBeatmapSetID.Value);
};
Child = new FillFlowContainer