Fix beatmap carousel tests loading beatmap manager beatmaps in test browser

This commit is contained in:
Dean Herbert 2020-03-12 15:26:22 +09:00
parent cb0e698e04
commit 28ac5af91c
2 changed files with 6 additions and 2 deletions

View File

@ -497,7 +497,7 @@ private void loadBeatmaps(List<BeatmapSetInfo> beatmapSets = null)
}
bool changed = false;
AddStep($"Load {beatmapSets.Count} Beatmaps", () =>
AddStep($"Load {(beatmapSets.Count > 0 ? beatmapSets.Count.ToString() : "some")} beatmaps", () =>
{
carousel.Filter(new FilterCriteria());
carousel.BeatmapSetsChanged = () => changed = true;
@ -697,6 +697,8 @@ private class TestBeatmapCarousel : BeatmapCarousel
public new List<DrawableCarouselItem> Items => base.Items;
public bool PendingFilterTask => PendingFilter != null;
protected override IEnumerable<BeatmapSetInfo> GetLoadableBeatmaps() => Enumerable.Empty<BeatmapSetInfo>();
}
}
}

View File

@ -153,9 +153,11 @@ private void load(OsuConfigManager config)
beatmaps.BeatmapHidden += beatmapHidden;
beatmaps.BeatmapRestored += beatmapRestored;
loadBeatmapSets(beatmaps.GetAllUsableBeatmapSetsEnumerable());
loadBeatmapSets(GetLoadableBeatmaps());
}
protected virtual IEnumerable<BeatmapSetInfo> GetLoadableBeatmaps() => beatmaps.GetAllUsableBeatmapSetsEnumerable();
public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() =>
{
var existingSet = beatmapSets.FirstOrDefault(b => b.BeatmapSet.ID == beatmapSet.ID);