Always use current ruleset to ensure URL is valid

This commit is contained in:
Dean Herbert 2022-06-15 02:38:44 +09:00
parent 1951eb30bc
commit c55c7becba

View File

@ -103,14 +103,12 @@ namespace osu.Desktop
if (getBeatmap(activity.Value) is IBeatmapInfo beatmap && beatmap.OnlineID > 0) if (getBeatmap(activity.Value) is IBeatmapInfo beatmap && beatmap.OnlineID > 0)
{ {
string rulesetShortName = (activity.Value as UserActivity.InGame)?.Ruleset.ShortName ?? string.Empty;
presence.Buttons = new[] presence.Buttons = new[]
{ {
new Button new Button
{ {
Label = "View beatmap", Label = "View beatmap",
Url = $@"{api.WebsiteRootUrl}/beatmapsets/{beatmap.BeatmapSet?.OnlineID}#{rulesetShortName}/{beatmap.OnlineID}" Url = $@"{api.WebsiteRootUrl}/beatmapsets/{beatmap.BeatmapSet?.OnlineID}#{ruleset.Value.ShortName}/{beatmap.OnlineID}"
} }
}; };
} }