mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Update existing subscriptions to new style
Fix missing detach calls in `MusicController`
This commit is contained in:
@ -190,13 +190,13 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
subscriptionSets = getBeatmapSets(realmFactory.Context).QueryAsyncWithNotifications(beatmapSetsChanged);
|
||||
subscriptionBeatmaps = realmFactory.Context.All<BeatmapInfo>().Where(b => !b.Hidden).QueryAsyncWithNotifications(beatmapsChanged);
|
||||
subscriptionSets = realmFactory.Register(realm => getBeatmapSets(realm).QueryAsyncWithNotifications(beatmapSetsChanged));
|
||||
subscriptionBeatmaps = realmFactory.Register(realm => realm.All<BeatmapInfo>().Where(b => !b.Hidden).QueryAsyncWithNotifications(beatmapsChanged));
|
||||
|
||||
// Can't use main subscriptions because we can't lookup deleted indices.
|
||||
// https://github.com/realm/realm-dotnet/discussions/2634#discussioncomment-1605595.
|
||||
subscriptionDeletedSets = realmFactory.Context.All<BeatmapSetInfo>().Where(s => s.DeletePending && !s.Protected).QueryAsyncWithNotifications(deletedBeatmapSetsChanged);
|
||||
subscriptionHiddenBeatmaps = realmFactory.Context.All<BeatmapInfo>().Where(b => b.Hidden).QueryAsyncWithNotifications(beatmapsChanged);
|
||||
subscriptionDeletedSets = realmFactory.Register(realm => realm.All<BeatmapSetInfo>().Where(s => s.DeletePending && !s.Protected).QueryAsyncWithNotifications(deletedBeatmapSetsChanged));
|
||||
subscriptionHiddenBeatmaps = realmFactory.Register(realm => realm.All<BeatmapInfo>().Where(b => b.Hidden).QueryAsyncWithNotifications(beatmapsChanged));
|
||||
}
|
||||
|
||||
private void deletedBeatmapSetsChanged(IRealmCollection<BeatmapSetInfo> sender, ChangeSet changes, Exception error)
|
||||
@ -552,10 +552,11 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private void signalBeatmapsLoaded()
|
||||
{
|
||||
Debug.Assert(BeatmapSetsLoaded == false);
|
||||
|
||||
BeatmapSetsChanged?.Invoke();
|
||||
BeatmapSetsLoaded = true;
|
||||
if (!BeatmapSetsLoaded)
|
||||
{
|
||||
BeatmapSetsChanged?.Invoke();
|
||||
BeatmapSetsLoaded = true;
|
||||
}
|
||||
|
||||
itemsCache.Invalidate();
|
||||
}
|
||||
|
Reference in New Issue
Block a user