mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-01 04:33:41 +00:00
Enhance output path selection in the GUI
Enables the use of template tokens when exporting multiple channels Closes #676
This commit is contained in:
@@ -158,22 +158,27 @@ public class DashboardViewModel : PropertyChangedBase
|
||||
|
||||
var exporter = new ChannelExporter(_discord);
|
||||
|
||||
var progresses = Enumerable
|
||||
.Range(0, dialog.Channels!.Count)
|
||||
.Select(_ => _progressMuxer.CreateInput())
|
||||
var channelProgressPairs = dialog
|
||||
.Channels!
|
||||
.Select(c => new
|
||||
{
|
||||
Channel = c,
|
||||
Progress = _progressMuxer.CreateInput()
|
||||
})
|
||||
.ToArray();
|
||||
|
||||
var successfulExportCount = 0;
|
||||
|
||||
await Parallel.ForEachAsync(
|
||||
dialog.Channels.Zip(progresses),
|
||||
channelProgressPairs,
|
||||
new ParallelOptions
|
||||
{
|
||||
MaxDegreeOfParallelism = Math.Max(1, _settingsService.ParallelLimit)
|
||||
},
|
||||
async (tuple, cancellationToken) =>
|
||||
async (pair, cancellationToken) =>
|
||||
{
|
||||
var (channel, progress) = tuple;
|
||||
var channel = pair.Channel;
|
||||
var progress = pair.Progress;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user