diff options
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/Dto/DtoService.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 9f36577410..94e2468719 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -205,7 +205,7 @@ namespace Emby.Server.Implementations.Dto // Batch-fetch MusicArtist lookups across all items to avoid N+1 queries. IReadOnlyDictionary<string, MusicArtist[]>? artistsBatch = null; - HashSet<string>? artistNames = null; + var artistNames = new HashSet<string>(StringComparer.Ordinal); foreach (var item in accessibleItems) { if (item is IHasArtist hasArtist) @@ -214,7 +214,7 @@ namespace Emby.Server.Implementations.Dto { if (!string.IsNullOrWhiteSpace(name)) { - (artistNames ??= new HashSet<string>(StringComparer.Ordinal)).Add(name); + artistNames.Add(name); } } } @@ -225,13 +225,13 @@ namespace Emby.Server.Implementations.Dto { if (!string.IsNullOrWhiteSpace(name)) { - (artistNames ??= new HashSet<string>(StringComparer.Ordinal)).Add(name); + artistNames.Add(name); } } } } - if (artistNames is { Count: > 0 }) + if (artistNames.Count > 0) { artistsBatch = _libraryManager.GetArtists(artistNames.ToArray()); } |
