mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 06:33:20 +08:00
remove try catch
This commit is contained in:
parent
f5226bd50b
commit
dadadaff65
@ -140,28 +140,20 @@ namespace osu.Game.Database
|
||||
/// <param name="notification">The notification will displayed to the user</param>
|
||||
private void exportZipArchive(TModel model, Stream outputStream, ProgressNotification notification)
|
||||
{
|
||||
try
|
||||
using (var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate)))
|
||||
{
|
||||
using (var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate)))
|
||||
float i = 0;
|
||||
|
||||
foreach (var file in model.Files)
|
||||
{
|
||||
float i = 0;
|
||||
notification.CancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
foreach (var file in model.Files)
|
||||
{
|
||||
notification.CancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
writer.Write(file.Filename, UserFileStorage.GetStream(file.File.GetStoragePath()));
|
||||
i++;
|
||||
notification.Progress = i / model.Files.Count();
|
||||
notification.Text = $"Exporting... ({i}/{model.Files.Count()})";
|
||||
}
|
||||
writer.Write(file.Filename, UserFileStorage.GetStream(file.File.GetStoragePath()));
|
||||
i++;
|
||||
notification.Progress = i / model.Files.Count();
|
||||
notification.Text = $"Exporting... ({i}/{model.Files.Count()})";
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
Logger.Log("Export operat canceled");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user