diff options
| -rw-r--r-- | Emby.Server.Implementations/Library/MusicManager.cs | 2 | ||||
| -rw-r--r-- | Jellyfin.Api/Controllers/InstantMixController.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvChannel.cs | 9 |
3 files changed, 7 insertions, 16 deletions
diff --git a/Emby.Server.Implementations/Library/MusicManager.cs b/Emby.Server.Implementations/Library/MusicManager.cs index c83737cec..3f2909947 100644 --- a/Emby.Server.Implementations/Library/MusicManager.cs +++ b/Emby.Server.Implementations/Library/MusicManager.cs @@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.Library list.AddRange(GetInstantMixFromGenres(item.Genres, user, dtoOptions)); - return list.ToImmutableList(); + return [.. list]; } /// <inheritdoc /> diff --git a/Jellyfin.Api/Controllers/InstantMixController.cs b/Jellyfin.Api/Controllers/InstantMixController.cs index e9dda19ca..e89e7ce26 100644 --- a/Jellyfin.Api/Controllers/InstantMixController.cs +++ b/Jellyfin.Api/Controllers/InstantMixController.cs @@ -393,21 +393,17 @@ public class InstantMixController : BaseJellyfinApiController private QueryResult<BaseItemDto> GetResult(IReadOnlyList<BaseItem> items, User? user, int? limit, DtoOptions dtoOptions) { - var list = items; + var totalCount = items.Count; - var totalCount = list.Count; - - if (limit.HasValue && limit < list.Count) + if (limit.HasValue && limit < items.Count) { - list = list.Take(limit.Value).ToImmutableArray(); + items = items.Take(limit.Value).ToImmutableArray(); } - var returnList = _dtoService.GetBaseItemDtos(list, dtoOptions, user); - var result = new QueryResult<BaseItemDto>( 0, totalCount, - returnList); + _dtoService.GetBaseItemDtos(items, dtoOptions, user)); return result; } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index 64d49d8c4..b10e77e10 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -120,13 +120,10 @@ namespace MediaBrowser.Controller.LiveTv return "TvChannel"; } - public IEnumerable<BaseItem> GetTaggedItems() - => Enumerable.Empty<BaseItem>(); + public IEnumerable<BaseItem> GetTaggedItems() => []; public override IReadOnlyList<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution) { - var list = new List<MediaSourceInfo>(); - var info = new MediaSourceInfo { Id = Id.ToString("N", CultureInfo.InvariantCulture), @@ -139,9 +136,7 @@ namespace MediaBrowser.Controller.LiveTv IsInfiniteStream = RunTimeTicks is null }; - list.Add(info); - - return list.ToImmutableList(); + return [info]; } public override IReadOnlyList<MediaStream> GetMediaStreams() |
