Fix imported count incrementing on failures

This commit is contained in:
Dean Herbert 2019-06-10 19:33:55 +09:00
parent 54497fb1e7
commit 29945f27c5
1 changed files with 1 additions and 4 deletions

View File

@ -162,6 +162,7 @@ await Task.WhenAll(paths.Select(async path =>
{
imported.Add(model);
Interlocked.Increment(ref current);
notification.Text = $"Imported {current} of {paths.Length} {humanisedModelName}s";
notification.Progress = (float)current / paths.Length;
}
@ -174,10 +175,6 @@ await Task.WhenAll(paths.Select(async path =>
{
Logger.Error(e, $@"Could not import ({Path.GetFileName(path)})");
}
finally
{
Interlocked.Increment(ref current);
}
}));
if (imported.Count == 0)