Order members regardless of name case

Add `toLower()` method to the sorting used in system lists, so members are ordered regardless of if the first letter of their name is upper or lowercase
This commit is contained in:
Grey Himmel 2019-08-25 20:25:37 -04:00 committed by GitHub
parent 1596694686
commit ad6624ce02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,7 +154,7 @@ namespace PluralKit.Bot.Commands
var members = await Members.GetBySystem(system); var members = await Members.GetBySystem(system);
var embedTitle = system.Name != null ? $"Members of {system.Name} (`{system.Hid}`)" : $"Members of `{system.Hid}`"; var embedTitle = system.Name != null ? $"Members of {system.Name} (`{system.Hid}`)" : $"Members of `{system.Hid}`";
await Context.Paginate<PKMember>( await Context.Paginate<PKMember>(
members.OrderBy(m => m.Name).ToList(), members.OrderBy(m => m.Name.toLower()).ToList(),
25, 25,
embedTitle, embedTitle,
(eb, ms) => eb.Description = string.Join("\n", ms.Select((m) => { (eb, ms) => eb.Description = string.Join("\n", ms.Select((m) => {
@ -328,4 +328,4 @@ namespace PluralKit.Bot.Commands
return res.IsSuccess ? res.BestMatch as PKSystem : null; return res.IsSuccess ? res.BestMatch as PKSystem : null;
} }
} }
} }