1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-08 13:07:24 +08:00

Merge pull request #16548 from peppy/music-controller-less-population

Remove pointless initial `MusicController` beatmap set population
This commit is contained in:
Bartłomiej Dach 2022-01-24 19:12:56 +01:00 committed by GitHub
commit d544c52f3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,16 +30,7 @@ namespace osu.Game.Overlays
[Resolved] [Resolved]
private BeatmapManager beatmaps { get; set; } private BeatmapManager beatmaps { get; set; }
public IBindableList<BeatmapSetInfo> BeatmapSets public IBindableList<BeatmapSetInfo> BeatmapSets => beatmapSets;
{
get
{
if (LoadState < LoadState.Ready)
throw new InvalidOperationException($"{nameof(BeatmapSets)} should not be accessed before the music controller is loaded.");
return beatmapSets;
}
}
/// <summary> /// <summary>
/// Point in time after which the current track will be restarted on triggering a "previous track" action. /// Point in time after which the current track will be restarted on triggering a "previous track" action.
@ -88,12 +79,6 @@ namespace osu.Game.Overlays
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
// ensure we're ready before completing async load.
// probably not a good way of handling this (as there is a period we aren't watching for changes until the realm subscription finishes up.
foreach (var s in queryRealmBeatmapSets())
beatmapSets.Add(s.Detach());
beatmapSubscription = realmFactory.RegisterForNotifications(realm => queryRealmBeatmapSets(), beatmapsChanged); beatmapSubscription = realmFactory.RegisterForNotifications(realm => queryRealmBeatmapSets(), beatmapsChanged);
} }