Fix difficulty retrieval for online-sourced beatmaps

This commit is contained in:
Bartłomiej Dach 2020-11-08 00:12:25 +01:00
parent 16f55de495
commit 6d4bb4316c

View File

@ -202,7 +202,9 @@ namespace osu.Game.Beatmaps
/// <param name="cancellationToken">A token that may be used to cancel this update.</param> /// <param name="cancellationToken">A token that may be used to cancel this update.</param>
private void updateBindable([NotNull] BindableStarDifficulty bindable, [CanBeNull] RulesetInfo rulesetInfo, [CanBeNull] IEnumerable<Mod> mods, CancellationToken cancellationToken = default) private void updateBindable([NotNull] BindableStarDifficulty bindable, [CanBeNull] RulesetInfo rulesetInfo, [CanBeNull] IEnumerable<Mod> mods, CancellationToken cancellationToken = default)
{ {
GetAsync(new DifficultyCacheLookup(bindable.Beatmap, rulesetInfo, mods), cancellationToken) // GetDifficultyAsync will fall back to existing data from BeatmapInfo if not locally available
// (contrary to GetAsync)
GetDifficultyAsync(bindable.Beatmap, rulesetInfo, mods, cancellationToken)
.ContinueWith(t => .ContinueWith(t =>
{ {
// We're on a threadpool thread, but we should exit back to the update thread so consumers can safely handle value-changed events. // We're on a threadpool thread, but we should exit back to the update thread so consumers can safely handle value-changed events.