Merge pull request #8922 from Bond-009/distinctby

Use DistinctBy introduced in .NET 6
This commit is contained in:
Claus Vium
2022-12-19 20:13:48 +01:00
committed by GitHub
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)
{