mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Update progress with the current item, not the next item
In the case where there is no next item, the progress will not get updated, so we'll essentially skip one element from filling the progress bar further. In the future we may/will want to not hide the notification upon completion, so this will look better in such scenarios.
This commit is contained in:
parent
101caf3064
commit
dc9fb84e25
@ -101,7 +101,7 @@ namespace osu.Game.Database
|
||||
using (ArchiveReader reader = getReaderFrom(path))
|
||||
imported.Add(Import(reader));
|
||||
|
||||
notification.Progress = (float)(current - 1) / paths.Length;
|
||||
notification.Progress = (float)current / paths.Length;
|
||||
|
||||
// We may or may not want to delete the file depending on where it is stored.
|
||||
// e.g. reconstructing/repairing database with items from default storage.
|
||||
@ -220,9 +220,11 @@ namespace osu.Game.Database
|
||||
// user requested abort
|
||||
return;
|
||||
|
||||
notification.Progress = (float)i / items.Count;
|
||||
notification.Text = $"Deleting ({++i} of {items.Count})";
|
||||
|
||||
Delete(b);
|
||||
|
||||
notification.Progress = (float)i / items.Count;
|
||||
}
|
||||
}
|
||||
|
||||
@ -256,9 +258,11 @@ namespace osu.Game.Database
|
||||
// user requested abort
|
||||
return;
|
||||
|
||||
notification.Progress = (float)i / items.Count;
|
||||
notification.Text = $"Restoring ({++i} of {items.Count})";
|
||||
|
||||
Undelete(item);
|
||||
|
||||
notification.Progress = (float)i / items.Count;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user