diff options
| author | Bond-009 <bond.009@outlook.com> | 2024-04-30 21:32:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-30 13:32:59 -0600 |
| commit | 3feb3f81bfe848aa829e7c129bee3cd060c23c05 (patch) | |
| tree | c247db8e30d1cc52bc6735d45d86eff8955ee7e9 /Jellyfin.Api/Controllers/ItemUpdateController.cs | |
| parent | 5dc6bb4910cfdc7f40ad83d647172d743e6e0595 (diff) | |
More efficient array creation (#11468)
Diffstat (limited to 'Jellyfin.Api/Controllers/ItemUpdateController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/ItemUpdateController.cs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Jellyfin.Api/Controllers/ItemUpdateController.cs b/Jellyfin.Api/Controllers/ItemUpdateController.cs index 56ef5f8f1..b4ce343be 100644 --- a/Jellyfin.Api/Controllers/ItemUpdateController.cs +++ b/Jellyfin.Api/Controllers/ItemUpdateController.cs @@ -264,7 +264,7 @@ public class ItemUpdateController : BaseJellyfinApiController if (request.Studios is not null) { - item.Studios = request.Studios.Select(x => x.Name).ToArray(); + item.Studios = Array.ConvertAll(request.Studios, x => x.Name); } if (request.DateCreated.HasValue) @@ -379,10 +379,7 @@ public class ItemUpdateController : BaseJellyfinApiController { if (item is IHasAlbumArtist hasAlbumArtists) { - hasAlbumArtists.AlbumArtists = request - .AlbumArtists - .Select(i => i.Name) - .ToArray(); + hasAlbumArtists.AlbumArtists = Array.ConvertAll(request.AlbumArtists, i => i.Name); } } @@ -390,10 +387,7 @@ public class ItemUpdateController : BaseJellyfinApiController { if (item is IHasArtist hasArtists) { - hasArtists.Artists = request - .ArtistItems - .Select(i => i.Name) - .ToArray(); + hasArtists.Artists = Array.ConvertAll(request.ArtistItems, i => i.Name); } } |
