diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 774a80049b..1adbb4a389 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -319,17 +319,17 @@ namespace osu.Game.Beatmaps /// /// This is a temporary method and will likely be replaced by a full-fledged (and more correctly placed) migration process in the future. /// - public async Task ImportFromStable() + public Task ImportFromStable() { var stable = GetStableStorage?.Invoke(); if (stable == null) { Logger.Log("No osu!stable installation available!", LoggingTarget.Information, LogLevel.Error); - return; + return Task.CompletedTask; } - await Task.Factory.StartNew(() => Import(stable.GetDirectories("Songs").Select(f => stable.GetFullPath(f)).ToArray()), TaskCreationOptions.LongRunning); + return Task.Factory.StartNew(() => Import(stable.GetDirectories("Songs").Select(f => stable.GetFullPath(f)).ToArray()), TaskCreationOptions.LongRunning); } /// diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 6c906bb1e4..085c591fce 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -67,7 +67,7 @@ namespace osu.Game.Beatmaps public bool BeatmapLoaded => beatmap.IsResultAvailable; public IBeatmap Beatmap => beatmap.Value.Result; - public async Task GetBeatmapAsync() => await beatmap.Value; + public Task GetBeatmapAsync() => beatmap.Value; private readonly AsyncLazy beatmap; private IBeatmap populateBeatmap() @@ -138,14 +138,14 @@ namespace osu.Game.Beatmaps public bool BackgroundLoaded => background.IsResultAvailable; public Texture Background => background.Value.Result; - public async Task GetBackgroundAsync() => await background.Value; + public Task GetBackgroundAsync() => background.Value; private AsyncLazy background; private Texture populateBackground() => GetBackground(); public bool TrackLoaded => track.IsResultAvailable; public Track Track => track.Value.Result; - public async Task GetTrackAsync() => await track.Value; + public Task GetTrackAsync() => track.Value; private AsyncLazy track; private Track populateTrack() @@ -158,21 +158,21 @@ namespace osu.Game.Beatmaps public bool WaveformLoaded => waveform.IsResultAvailable; public Waveform Waveform => waveform.Value.Result; - public async Task GetWaveformAsync() => await waveform.Value; + public Task GetWaveformAsync() => waveform.Value; private readonly AsyncLazy waveform; private Waveform populateWaveform() => GetWaveform(); public bool StoryboardLoaded => storyboard.IsResultAvailable; public Storyboard Storyboard => storyboard.Value.Result; - public async Task GetStoryboardAsync() => await storyboard.Value; + public Task GetStoryboardAsync() => storyboard.Value; private readonly AsyncLazy storyboard; private Storyboard populateStoryboard() => GetStoryboard(); public bool SkinLoaded => skin.IsResultAvailable; public Skin Skin => skin.Value.Result; - public async Task GetSkinAsync() => await skin.Value; + public Task GetSkinAsync() => skin.Value; private readonly AsyncLazy skin; private Skin populateSkin() => GetSkin(); diff --git a/osu.Game/Graphics/ScreenshotManager.cs b/osu.Game/Graphics/ScreenshotManager.cs index 63b97e3c59..8426dc995b 100644 --- a/osu.Game/Graphics/ScreenshotManager.cs +++ b/osu.Game/Graphics/ScreenshotManager.cs @@ -71,7 +71,7 @@ namespace osu.Game.Graphics private volatile int screenShotTasks; - public async Task TakeScreenshotAsync() => await Task.Run(async () => + public Task TakeScreenshotAsync() => Task.Run(async () => { Interlocked.Increment(ref screenShotTasks); diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index f9801c2f92..9c881c6abb 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -111,10 +111,10 @@ namespace osu.Game.Skinning byte[] IResourceStore.Get(string name) => GetAsync(name).Result; - public async Task GetAsync(string name) + public Task GetAsync(string name) { string path = getPathForFile(name); - return path == null ? null : await underlyingStore.GetAsync(path); + return path == null ? Task.FromResult(null) : underlyingStore.GetAsync(path); } #region IDisposable Support