Use DistinctBy introduced in .NET 6

This commit is contained in:
Bond_009
2022-12-19 15:21:42 +01:00
parent 411246e90f
commit 6481376b81
12 changed files with 19 additions and 37 deletions

View File

@@ -574,8 +574,7 @@ namespace Emby.Server.Implementations.Dto
.Where(i => user is null ?
true :
i.IsVisible(user))
.GroupBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
.Select(x => x.First())
.DistinctBy(x => x.Name, StringComparer.OrdinalIgnoreCase)
.ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase);
for (var i = 0; i < people.Count; i++)