mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-23 11:16:59 -04:00
[GUI] Notify when all exports are done instead of each of them separately
This commit is contained in:
parent
1325edb135
commit
26322da800
1 changed files with 6 additions and 2 deletions
|
@ -253,6 +253,7 @@ namespace DiscordChatExporter.Gui.ViewModels
|
||||||
var operations = ProgressManager.CreateOperations(dialog.Channels.Count);
|
var operations = ProgressManager.CreateOperations(dialog.Channels.Count);
|
||||||
|
|
||||||
// Export channels
|
// Export channels
|
||||||
|
var successfulExportCount = 0;
|
||||||
for (var i = 0; i < dialog.Channels.Count; i++)
|
for (var i = 0; i < dialog.Channels.Count; i++)
|
||||||
{
|
{
|
||||||
// Get operation and channel
|
// Get operation and channel
|
||||||
|
@ -281,8 +282,8 @@ namespace DiscordChatExporter.Gui.ViewModels
|
||||||
await _exportService.ExportChatLogAsync(chatLog, filePath, dialog.SelectedFormat,
|
await _exportService.ExportChatLogAsync(chatLog, filePath, dialog.SelectedFormat,
|
||||||
dialog.PartitionLimit);
|
dialog.PartitionLimit);
|
||||||
|
|
||||||
// Notify completion
|
// Report successful export
|
||||||
Notifications.Enqueue($"Channel [{channel.Model.Name}] successfully exported");
|
successfulExportCount++;
|
||||||
}
|
}
|
||||||
catch (HttpErrorStatusCodeException ex) when (ex.StatusCode == HttpStatusCode.Forbidden)
|
catch (HttpErrorStatusCodeException ex) when (ex.StatusCode == HttpStatusCode.Forbidden)
|
||||||
{
|
{
|
||||||
|
@ -298,6 +299,9 @@ namespace DiscordChatExporter.Gui.ViewModels
|
||||||
operation.Dispose();
|
operation.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notify of overall completion
|
||||||
|
Notifications.Enqueue($"Successfully exported {successfulExportCount} channel(s)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue