mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 04:13:00 +08:00
Simplify tracking of hidden beatmaps
Handling a few extra events is preferrable to keeping a second realm subscription live.
This commit is contained in:
parent
151c448535
commit
1095137a5b
@ -198,7 +198,6 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private IDisposable? subscriptionSets;
|
private IDisposable? subscriptionSets;
|
||||||
private IDisposable? subscriptionBeatmaps;
|
private IDisposable? subscriptionBeatmaps;
|
||||||
private IDisposable? subscriptionHiddenBeatmaps;
|
|
||||||
|
|
||||||
private readonly DrawablePool<DrawableCarouselBeatmapSet> setPool = new DrawablePool<DrawableCarouselBeatmapSet>(100);
|
private readonly DrawablePool<DrawableCarouselBeatmapSet> setPool = new DrawablePool<DrawableCarouselBeatmapSet>(100);
|
||||||
|
|
||||||
@ -263,10 +262,6 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
subscriptionSets = realm.RegisterForNotifications(getBeatmapSets, beatmapSetsChanged);
|
subscriptionSets = realm.RegisterForNotifications(getBeatmapSets, beatmapSetsChanged);
|
||||||
subscriptionBeatmaps = realm.RegisterForNotifications(r => r.All<BeatmapInfo>().Where(b => !b.Hidden), beatmapsChanged);
|
subscriptionBeatmaps = realm.RegisterForNotifications(r => r.All<BeatmapInfo>().Where(b => !b.Hidden), beatmapsChanged);
|
||||||
|
|
||||||
// Can't use main subscriptions because we can't lookup deleted indices.
|
|
||||||
// https://github.com/realm/realm-dotnet/discussions/2634#discussioncomment-1605595.
|
|
||||||
subscriptionHiddenBeatmaps = realm.RegisterForNotifications(r => r.All<BeatmapInfo>().Where(b => b.Hidden), beatmapsChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void beatmapSetsChanged(IRealmCollection<BeatmapSetInfo> sender, ChangeSet? changes)
|
private void beatmapSetsChanged(IRealmCollection<BeatmapSetInfo> sender, ChangeSet? changes)
|
||||||
@ -1279,7 +1274,6 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
subscriptionSets?.Dispose();
|
subscriptionSets?.Dispose();
|
||||||
subscriptionBeatmaps?.Dispose();
|
subscriptionBeatmaps?.Dispose();
|
||||||
subscriptionHiddenBeatmaps?.Dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user