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

@@ -133,8 +133,7 @@ namespace Emby.Server.Implementations.IO
.Distinct(StringComparer.OrdinalIgnoreCase)
.Select(GetAffectedBaseItem)
.Where(item => item is not null)
.GroupBy(x => x!.Id) // Removed null values in the previous .Where()
.Select(x => x.First())!;
.DistinctBy(x => x!.Id)!; // Removed null values in the previous .Where()
foreach (var item in itemsToRefresh)
{