mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Applied Review Comments
This commit is contained in:
parent
b73985e04f
commit
05ffa7b413
@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
list.AddRange(GetInstantMixFromGenres(item.Genres, user, dtoOptions));
|
||||
|
||||
return list.ToImmutableList();
|
||||
return [.. list];
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user