Merge pull request #11907 from peppy/fix-import-from-stable-no-beatmaps-message

Fix "failed to import" message showing when importing from a stable install with no beatmaps
This commit is contained in:
Dan Balasescu 2021-02-26 18:45:54 +09:00 committed by GitHub
commit d7f3519bd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -141,6 +141,13 @@ public Task Import(params ImportTask[] tasks)
protected async Task<IEnumerable<TModel>> Import(ProgressNotification notification, params ImportTask[] tasks)
{
if (tasks.Length == 0)
{
notification.CompletionText = $"No {HumanisedModelName}s were found to import!";
notification.State = ProgressNotificationState.Completed;
return Enumerable.Empty<TModel>();
}
notification.Progress = 0;
notification.Text = $"{HumanisedModelName.Humanize(LetterCasing.Title)} import is initialising...";