aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/LibraryController.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2022-12-19 20:13:48 +0100
committerGitHub <noreply@github.com>2022-12-19 20:13:48 +0100
commit760b7f8fca95b580ba3c9b77493c22b84e871eca (patch)
tree73bb3f1ef72d8dd837cbe1d131fa2c2a99287836 /Jellyfin.Api/Controllers/LibraryController.cs
parentf20dee8e0d1160ff9e3fac127ebba66e6ecac5da (diff)
parent6481376b81c52af0b29eea997ce44de0de862ac8 (diff)
Merge pull request #8922 from Bond-009/distinctby
Use DistinctBy introduced in .NET 6
Diffstat (limited to 'Jellyfin.Api/Controllers/LibraryController.cs')
-rw-r--r--Jellyfin.Api/Controllers/LibraryController.cs15
1 files changed, 5 insertions, 10 deletions
diff --git a/Jellyfin.Api/Controllers/LibraryController.cs b/Jellyfin.Api/Controllers/LibraryController.cs
index ab2020830..196d509fb 100644
--- a/Jellyfin.Api/Controllers/LibraryController.cs
+++ b/Jellyfin.Api/Controllers/LibraryController.cs
@@ -770,8 +770,7 @@ namespace Jellyfin.Api.Controllers
Name = i.Name,
DefaultEnabled = IsSaverEnabledByDefault(i.Name, types, isNewLibrary)
})
- .GroupBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
- .Select(x => x.First())
+ .DistinctBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
.ToArray();
result.MetadataReaders = plugins
@@ -781,8 +780,7 @@ namespace Jellyfin.Api.Controllers
Name = i.Name,
DefaultEnabled = true
})
- .GroupBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
- .Select(x => x.First())
+ .DistinctBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
.ToArray();
result.SubtitleFetchers = plugins
@@ -792,8 +790,7 @@ namespace Jellyfin.Api.Controllers
Name = i.Name,
DefaultEnabled = true
})
- .GroupBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
- .Select(x => x.First())
+ .DistinctBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
.ToArray();
var typeOptions = new List<LibraryTypeOptionsDto>();
@@ -814,8 +811,7 @@ namespace Jellyfin.Api.Controllers
Name = i.Name,
DefaultEnabled = IsMetadataFetcherEnabledByDefault(i.Name, type, isNewLibrary)
})
- .GroupBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
- .Select(x => x.First())
+ .DistinctBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
.ToArray(),
ImageFetchers = plugins
@@ -826,8 +822,7 @@ namespace Jellyfin.Api.Controllers
Name = i.Name,
DefaultEnabled = IsImageFetcherEnabledByDefault(i.Name, type, isNewLibrary)
})
- .GroupBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
- .Select(x => x.First())
+ .DistinctBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
.ToArray(),
SupportedImageTypes = plugins