mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 05:42:56 +08:00
Order imports depending on beatmap imports if any is running.
This commit is contained in:
parent
851e33fd15
commit
325a689d65
@ -48,18 +48,29 @@ namespace osu.Game.Database
|
||||
var stableStorage = await getStableStorage().ConfigureAwait(false);
|
||||
var importTasks = new List<Task>();
|
||||
|
||||
Task beatmapImportTask = default;
|
||||
if (content.HasFlagFast(StableContent.Beatmaps))
|
||||
importTasks.Add(beatmaps.ImportFromStableAsync(stableStorage));
|
||||
|
||||
if (content.HasFlagFast(StableContent.Collections))
|
||||
importTasks.Add(collections.ImportFromStableAsync(stableStorage));
|
||||
|
||||
if (content.HasFlagFast(StableContent.Scores))
|
||||
importTasks.Add(scores.ImportFromStableAsync(stableStorage));
|
||||
importTasks.Add(beatmapImportTask = beatmaps.ImportFromStableAsync(stableStorage));
|
||||
|
||||
if (content.HasFlagFast(StableContent.Skins))
|
||||
importTasks.Add(skins.ImportFromStableAsync(stableStorage));
|
||||
|
||||
if (content.HasFlagFast(StableContent.Collections))
|
||||
{
|
||||
if (beatmapImportTask != null)
|
||||
importTasks.Add(beatmapImportTask.ContinueWith(_ => collections.ImportFromStableAsync(stableStorage), TaskContinuationOptions.OnlyOnRanToCompletion));
|
||||
else
|
||||
importTasks.Add(collections.ImportFromStableAsync(stableStorage));
|
||||
}
|
||||
|
||||
if (content.HasFlagFast(StableContent.Scores))
|
||||
{
|
||||
if (beatmapImportTask != null)
|
||||
importTasks.Add(beatmapImportTask.ContinueWith(_ => scores.ImportFromStableAsync(stableStorage), TaskContinuationOptions.OnlyOnRanToCompletion));
|
||||
else
|
||||
importTasks.Add(scores.ImportFromStableAsync(stableStorage));
|
||||
}
|
||||
|
||||
await Task.WhenAll(importTasks.ToArray()).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user