[CLI] Fix sorting by channel/category position (#490)

This commit is contained in:
Lucas LaBuff
2021-01-31 10:23:46 -05:00
committed by GitHub
parent 77b7977324
commit 8b9afe45b9
6 changed files with 22 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ using CliFx;
using CliFx.Attributes;
using DiscordChatExporter.Cli.Commands.Base;
using DiscordChatExporter.Domain.Discord.Models;
using DiscordChatExporter.Domain.Discord.Models.Common;
using DiscordChatExporter.Domain.Utilities;
namespace DiscordChatExporter.Cli.Commands
@@ -15,7 +16,7 @@ namespace DiscordChatExporter.Cli.Commands
{
var channels = await GetDiscordClient().GetGuildChannelsAsync(Guild.DirectMessages.Id);
foreach (var channel in channels.OrderBy(c => c.Category).ThenBy(c => c.Name))
foreach (var channel in channels.OrderBy(c => c.Category, PositionBasedComparer.Instance).ThenBy(c => c.Name))
console.Output.WriteLine($"{channel.Id} | {channel.Category} / {channel.Name}");
}
}