Skip to content

Commit

Permalink
Update notification text when import is paused due to gameplay
Browse files Browse the repository at this point in the history
Addresses #30388.
  • Loading branch information
peppy committed Oct 23, 2024
1 parent 7df3976 commit be5cb20
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion osu.Game/Database/RealmArchiveModelImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,25 @@ public async Task<IEnumerable<Live<TModel>>> Import(ProgressNotification notific
}

notification.Progress = 0;
notification.Text = $"{HumanisedModelName.Humanize(LetterCasing.Title)} import is initialising...";

int current = 0;

var imported = new List<Live<TModel>>();

parameters.Batch |= tasks.Length >= minimum_items_considered_batch_import;

// A paused state could obviously be entered mid-import (during the `Task.WhenAll` below),
// but in order to keep things simple let's focus on the most common scenario.
notification.Text = $"{HumanisedModelName.Humanize(LetterCasing.Title)} import is paused due to gameplay...";

try
{
pauseIfNecessary(parameters, notification.CancellationToken);
}
catch { }

notification.Text = $"{HumanisedModelName.Humanize(LetterCasing.Title)} import is initialising...";

await Task.WhenAll(tasks.Select(async task =>
{
if (notification.CancellationToken.IsCancellationRequested)
Expand Down

0 comments on commit be5cb20

Please sign in to comment.