diff options
| author | Bond_009 <bond.009@outlook.com> | 2022-12-19 15:21:42 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2022-12-19 15:21:42 +0100 |
| commit | 6481376b81c52af0b29eea997ce44de0de862ac8 (patch) | |
| tree | 046163c8d357783439f9b849bc07012abf3fd206 /Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs | |
| parent | 411246e90f19f652168878e0edc703fdc9ff32d9 (diff) | |
Use DistinctBy introduced in .NET 6
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs')
| -rw-r--r-- | Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs index 25a7029c9..05d0a9b79 100644 --- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs +++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs @@ -282,19 +282,16 @@ namespace Emby.Server.Implementations.EntryPoints { // Remove dupes in case some were saved multiple times var foldersAddedTo = _foldersAddedTo - .GroupBy(x => x.Id) - .Select(x => x.First()) + .DistinctBy(x => x.Id) .ToList(); var foldersRemovedFrom = _foldersRemovedFrom - .GroupBy(x => x.Id) - .Select(x => x.First()) + .DistinctBy(x => x.Id) .ToList(); var itemsUpdated = _itemsUpdated .Where(i => !_itemsAdded.Contains(i)) - .GroupBy(x => x.Id) - .Select(x => x.First()) + .DistinctBy(x => x.Id) .ToList(); SendChangeNotifications(_itemsAdded.ToList(), itemsUpdated, _itemsRemoved.ToList(), foldersAddedTo, foldersRemovedFrom, CancellationToken.None).GetAwaiter().GetResult(); |
