1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-16 18:38:32 +08:00

Move realm collection retrieval to exist beside beatmap retrieval for organisation

This commit is contained in:
Dean Herbert
2025-08-01 16:27:07 +09:00
Unverified
parent c3396a93a6
commit 2d748e24ec
+5 -5
View File
@@ -52,9 +52,6 @@ namespace osu.Game.Screens.SelectV2
private readonly BeatmapCarouselFilterMatching matching;
private readonly BeatmapCarouselFilterGrouping grouping;
[Resolved]
private RealmAccess realm { get; set; } = null!;
/// <summary>
/// Total number of beatmap difficulties displayed with the filter.
/// </summary>
@@ -102,17 +99,18 @@ namespace osu.Game.Screens.SelectV2
{
matching = new BeatmapCarouselFilterMatching(() => Criteria!),
new BeatmapCarouselFilterSorting(() => Criteria!),
grouping = new BeatmapCarouselFilterGrouping(() => Criteria!, () => realm.Run(r => r.All<BeatmapCollection>().AsEnumerable().Detach())),
grouping = new BeatmapCarouselFilterGrouping(() => Criteria!, () => detachedCollections())
};
AddInternal(loading = new LoadingLayer());
}
[BackgroundDependencyLoader]
private void load(BeatmapStore beatmapStore, AudioManager audio, OsuConfigManager config, CancellationToken? cancellationToken)
private void load(BeatmapStore beatmapStore, RealmAccess realm, AudioManager audio, OsuConfigManager config, CancellationToken? cancellationToken)
{
setupPools();
detachedBeatmaps = beatmapStore.GetBeatmapSets(cancellationToken);
detachedCollections = () => realm.Run(r => r.All<BeatmapCollection>().AsEnumerable().Detach());
loadSamples(audio);
config.BindWith(OsuSetting.RandomSelectAlgorithm, randomAlgorithm);
@@ -700,6 +698,8 @@ namespace osu.Game.Screens.SelectV2
private Sample? spinSample;
private Sample? randomSelectSample;
private Func<List<BeatmapCollection>> detachedCollections = null!;
public bool NextRandom()
{
var carouselItems = GetCarouselItems();