mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 09:57:21 +09: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>
|
/// <param name="notification">The notification will displayed to the user</param>
|
||||||
private void exportZipArchive(TModel model, Stream outputStream, ProgressNotification notification)
|
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)
|
writer.Write(file.Filename, UserFileStorage.GetStream(file.File.GetStoragePath()));
|
||||||
{
|
i++;
|
||||||
notification.CancellationToken.ThrowIfCancellationRequested();
|
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…
x
Reference in New Issue
Block a user