From 74603253d2522baeb5342a68ee970c387efdb69a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Nov 2021 13:42:56 +0100 Subject: [PATCH] Store full model rather than online ID only --- .../Beatmaps/Drawables/Cards/Buttons/FavouriteButton.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/Cards/Buttons/FavouriteButton.cs b/osu.Game/Beatmaps/Drawables/Cards/Buttons/FavouriteButton.cs index a61065b468..9fed2fde6f 100644 --- a/osu.Game/Beatmaps/Drawables/Cards/Buttons/FavouriteButton.cs +++ b/osu.Game/Beatmaps/Drawables/Cards/Buttons/FavouriteButton.cs @@ -23,7 +23,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons set => current.Current = value; } - private readonly int onlineBeatmapID; + private readonly APIBeatmapSet beatmapSet; private PostBeatmapFavouriteRequest favouriteRequest; @@ -33,7 +33,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons public FavouriteButton(APIBeatmapSet beatmapSet) { current = new BindableWithCurrent(new BeatmapSetFavouriteState(beatmapSet.HasFavourited, beatmapSet.FavouriteCount)); - onlineBeatmapID = beatmapSet.OnlineID; + this.beatmapSet = beatmapSet; } protected override void LoadComplete() @@ -49,7 +49,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons var actionType = current.Value.Favourited ? BeatmapFavouriteAction.UnFavourite : BeatmapFavouriteAction.Favourite; favouriteRequest?.Cancel(); - favouriteRequest = new PostBeatmapFavouriteRequest(onlineBeatmapID, actionType); + favouriteRequest = new PostBeatmapFavouriteRequest(beatmapSet.OnlineID, actionType); Enabled.Value = false; favouriteRequest.Success += () =>