From 46e92c3b601a59d34c85275c74e9af347dd7f3a4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Jan 2022 21:44:18 +0900 Subject: [PATCH] Clean up `BeatmapManager` query methods --- osu.Game/Beatmaps/BeatmapManager.cs | 17 ----------------- osu.Game/Screens/Menu/IntroScreen.cs | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 15dc0c9b61..2cdae2b047 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -151,22 +151,6 @@ namespace osu.Game.Beatmaps return context.All().Where(b => !b.DeletePending).Detach(); } - /// - /// Perform a lookup query on available s. - /// - /// The query. - /// Results from the provided query. - public List> QueryBeatmapSets(Expression> query) - { - using (var context = contextFactory.CreateContext()) - { - return context.All() - .Where(b => !b.DeletePending) - .Where(query) - .ToLive(contextFactory); - } - } - /// /// Perform a lookup query on available s. /// @@ -197,7 +181,6 @@ namespace osu.Game.Beatmaps /// The query. /// The first result for the provided query, or null if no results were found. public BeatmapInfo? QueryBeatmap(Expression> query) => beatmapModelManager.QueryBeatmap(query)?.Detach(); - // TODO: move detach to usages? /// /// Saves an file against a given . diff --git a/osu.Game/Screens/Menu/IntroScreen.cs b/osu.Game/Screens/Menu/IntroScreen.cs index 09a9f44558..c4343625ab 100644 --- a/osu.Game/Screens/Menu/IntroScreen.cs +++ b/osu.Game/Screens/Menu/IntroScreen.cs @@ -131,7 +131,7 @@ namespace osu.Game.Screens.Menu bool loadThemedIntro() { - setInfo = beatmaps.QueryBeatmapSets(b => b.Hash == BeatmapHash).FirstOrDefault(); + setInfo = beatmaps.QueryBeatmapSet(b => b.Hash == BeatmapHash); if (setInfo == null) return false;