From 495636538fc23101ec641bdf66eb0ba8b3f6a88c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 21 Jan 2022 17:33:26 +0900 Subject: [PATCH] Add forced refresh on `GetAllUsableBeatmapSets()` This is commonly used in tests in a way where it's not feasible to guarantee correct results unless a refresh is called. This method shouldn't really be used outside of tests anyway, but that's for a folow-up effort. --- osu.Game/Beatmaps/BeatmapManager.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index a9340e1250..43e4b482bd 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -171,7 +171,11 @@ namespace osu.Game.Beatmaps /// A list of available . public List GetAllUsableBeatmapSets() { - return contextFactory.Run(realm => realm.All().Where(b => !b.DeletePending).Detach()); + return contextFactory.Run(realm => + { + realm.Refresh(); + return realm.All().Where(b => !b.DeletePending).Detach(); + }); } ///